log4j logging format

General help on how to use Cerberus. Questions on how a particular feature works, how to use feature x with feature y... Please read the "How to use this forum" article before posting.
Post Reply
jurajg
Posts: 1
Joined: Wed Mar 14, 2018 8:51 am

log4j logging format

Post by jurajg » Wed Mar 14, 2018 9:09 am

Hi,
i would like to confirm with you the possibility of changing the format of logged events with log4j. Currently he messages are stored in log files in UTF-8 or UTF-16. Parsing of log files on MS Windows with findstr or grep works suboptimaly as text is space padded, we need to confirm with you the option changing the encoding to UNICODE or ANSI which would store the text in logs without space padding. Is my approach correct ?

I noticed that with fresh installed version >9, we get UTF-8 and with upgraded we have mix UTF-8 and UTF-16 in log4j.xml|log4j_ui.xml encoding .
What is the reason for the difference?

Could you please confirm what is the purpose to use of log4j.xml and log4j_ui.xml configs per example bellow?

>>>>>>>> log4j.xml <<<<<<<<<
<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="false">
<appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
<param name="encoding" value="UTF-8" />


>>>>>>>> log4j_ui.xml <<<<<<<<<
<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="false">
<appender name="FILE_UI" class="org.apache.log4j.rolling.RollingFileAppender">
<param name="encoding" value="UTF-16" />
<param name="threshold" value="INFO" />

thanks, jurajg

Post Reply