Hi Log4j-Dev, Bug Description: I am using SyslogAppender to redirect the application specific logs to Unix Syslog but I am unable to find the Header of the Custom layout in Syslogs.Currently I am using log4j 1.2.8 Observation: When I observe other appenders they are extending WriteAppender class which has writeHeader() funtion to log the Header.But I found that this functionality is missing in SyslogAppender. So when I simply use the SyslogAppender with the extra function WriteHeader() and just append to the writerlayout.getHeader().I am able to log the header I have seen that this funtionality is even missing in log4j 1.2.13. If I am not wrong Can you please let me know whether there is any possibility of logging the header information with the existing verison(Currently I am using log4j 1.2.8.) or When can I get the required funtionality in log4j builds because my application is unabling the cilents to configure the logs Waiting to find the fix in log4j builds soon Thanks and Regards, Aparna
Do you think that the layout header should be written once at the appender initialization, once at the first processed log request or once per log request? Should the footer be written once when the appender is closed or once per log request?
SyslogAppender should be similar to other appenders in logging the header and footer.So I think that header should be logged once at the first processed log request and footer once when the appender is closed. In case of reloading(change)the properties or config file,Logging of headers and footers should be similar to other appenders
SysLogAppender now is a subclass of WriterAppender and behaves the same as other appenders writing the footer and header at activation and closing. This is checked into SVN trunk, pending for 1.3
Committed by Elias against log4j/trunk in rev 500749. Changing the base class of an established appender is a pretty significant architectural change for such a small enhancement and would have benefitted from prior discussion. I would be very reluctant to make such a change in log4j 1.2.x and the 1.3 patch should be reviewed. I think it is likely that the rebasing of the class may have introduced behavioral changes (buffering, encoding, etc) in addition to the desired change.
Committed minor tweak to SyslogAppender in log4j 1.2 branch on rev 510695 to address this issue. Header will be emitted on either call to activateOptions() or first handled logging event, footer will be sent on close if initialization got to either of those points.