All validation results will be reported using the logging system 'Log4j version 2'. This may seem unnecessarily complex, but it allowes the monitoring to be extended by other logging appenders. Other appenders may log to a file or to a log management system like Graylog2 and LogStash.
The configuration file log4j2.xml
is located in the directory PDFUNIT_MONITOR_HOME/conf
.
Log4j2 is configured by PDFUnit to send log events not only to the appender
'PDFUnitMonitorAppender' but also to a file appender which writes to
PDFUNIT_MONITOR_HOME/log/pdfunit-monitor.log
.
<Configuration monitorInterval="10"> <Appenders> <File name="XmlFileAppender" fileName="./log/pdfunit-monitor.log" append="true" bufferedIO="false" bufferSize="100" immediateFlush="true" > <XMLLayout complete="true" charset="UTF-8" compact="false"/> </File> <Console name="ConsoleAppender" target="SYSTEM_OUT"> <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> </Console> <Socket name="PDFUnitMonitorAppender" host="localHost" port="4445"> <SerializedLayout /> </Socket> </Appenders> <Loggers> <Logger name="PDFConstraints" level="all" additivity="false"> <AppenderRef ref="XmlFileAppender"/> <AppenderRef ref="PDFUnitMonitorAppender"/> <!-- <AppenderRef ref="ConsoleAppender"/> --> </Logger> <Root level="off"> <AppenderRef ref="ConsoleAppender"/> </Root> </Loggers> </Configuration>
Log-events can be filtered out by using a log level.
By default, the level of the logger PDFConstraints
is set to all
.
That means, all events will be sent to the result list.
They can be filtered out from this list later by using the existing error-level filter.
The logging appender 'PDFUnitMonitorAppender' sends all validation events
to the user interface using a socket. If its default port 4445 is beeing used by another
application, change the port number in the files pdfunit-monitor.config
and
log4j2.xml
.
Further information about Log4j2 can be found in the Internet:
Project home: http://logging.apache.org/log4j/2.x/index.html.
Apache Log4j 2, User's Guide: log4j-users-guide.pdf.