Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Skipping outline-color (null) #96

Open
feiyuone opened this issue Jul 4, 2023 · 1 comment
Open

Log Skipping outline-color (null) #96

feiyuone opened this issue Jul 4, 2023 · 1 comment

Comments

@feiyuone
Copy link

feiyuone commented Jul 4, 2023

hello,
when I use docx4j-ImportXHTML convert a html file to docx file,I got a lot of logs like these:

08:58:00.308 [http-nio-8080-exec-3] WARN o.d.c.in.xhtml.XHTMLImporterImpl 784 - Skipping clip .. (null value)
08:58:00.309 [http-nio-8080-exec-3] WARN o.d.c.in.xhtml.XHTMLImporterImpl 784 - Skipping outline-color .. (null value)
08:58:00.309 [http-nio-8080-exec-3] WARN o.d.c.in.xhtml.XHTMLImporterImpl 784 - Skipping outline-style .. (null value)
08:58:00.309 [http-nio-8080-exec-3] WARN o.d.c.in.xhtml.XHTMLImporterImpl 784 - Skipping outline-width .. (null value)
08:58:00.309 [http-nio-8080-exec-3] WARN o.d.c.in.xhtml.XHTMLImporterImpl 784 - Skipping unicode-bidi .. (null value)

the java version is 1.8.0_371,docx4j-ImportXHTML is 8.3.8.
how can i fixed it or how can i block these logs?
thanks for advanced!

@mmatias27
Copy link

mmatias27 commented Dec 1, 2023

Hello.
I had the same problem.
I solved it by filtering the log lines, creating a filter in the logback.xml file

<configuration>
	<appender name="STDOUT"	class="ch.qos.logback.core.ConsoleAppender">
		<filter class="ch.qos.logback.core.filter.EvaluatorFilter">      
			<evaluator> <!-- defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator -->
			  <expression>
				if( logger.contains("XHTMLImporterImpl") &amp;&amp; <!-- & encoded as &amp; -->
					level == WARN &amp;&amp;
					message.contains(".. (null value)")) {
			  			return true;
				}
		
				return false;
			  </expression>
			</evaluator>
			<OnMismatch>NEUTRAL</OnMismatch>
			<OnMatch>DENY</OnMatch>
		</filter>		
		<encoder>
			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread]  %-60logger{40} %-5line: %msg%n
			</pattern>
		</encoder>
	</appender>

    <logger name="org.docx4j" level="WARN" />
	
    <root level="INFO">
		<appender-ref ref="STDOUT" />
	</root>

</configuration>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants