FAQ  •  Register  •  Login

Take advantage of advanced Log4J features

<<

wagstaff

User avatar

Serviio lover

Posts: 52

Joined: Wed Dec 22, 2010 5:35 pm

Location: San Antonio, TX, USA

Post Tue Jan 11, 2011 11:32 pm

Take advantage of advanced Log4J features

Since Serviio is already using the Apache Log4J library to handle its logging, it would be nice if Serviio took advantage of some of Log4J's most powerful features like the RollingPolicy and TriggeringPolicy. When debugging issues with Serviio, we often need to set the logging level to "DEBUG" so that we can capture additional information about what Serviio is doing or attempting to do. Unfortunately, with the current configuration, once the existing log file fills up (and it fills up very quickly in DEBUG mode!), it gets erased and a new log file begins. With full implementation of the RollingPolicy and TriggeringPolicy, we could keep the earlier log files instead of watching it fall off into the "bitbucket". I realize that this may not be a highly used feature enhancement for most, but I figure it is merely a couple dozen lines of Java code to implement.
Joe Philipp
Samsung UN46C6900 | Windows Server 2003 SP2 | Mac OS X 10.5.8 | Kubuntu/Ubuntu 11.04
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Jan 12, 2011 12:13 am

Re: Take advantage of advanced Log4J features

There is a rolling policy in the log4j config file. It should roll into serviio.log.1, serviio.log.2, etc (max 5)
<<

wagstaff

User avatar

Serviio lover

Posts: 52

Joined: Wed Dec 22, 2010 5:35 pm

Location: San Antonio, TX, USA

Post Wed Jan 12, 2011 2:30 am

Re: Take advantage of advanced Log4J features

Hmmm. I was thinking the same thing, however, the behavior I see is that the serviio.log file grows up to the size specified by the "MaxFileSize" parameter specified in the log4j.xml and then zeroes out and begins to grow again. The file is never renamed as serviio.log.1, serviio.log.2, etc. as the new log file serviio.log is created.

I assumed that this behavior was due to the fact that you have bundled a slightly older version of the log4j.jar library with Serviio and that Serviio was not taking advantage of the newer features of Log4J. The bundled file appears to be v1.2.14, but the current stable release version from Apache is 1.2.16. The latest release also uses the log4j-extras.jar library which implements a number of additional classes such as "FixedWindowRollingPolicy.class", "TimeBasedRollingPolicy.class", and "SizeBasedTriggeringPolicy.class" among others which allow you to finely control the rollover process.

If you have been able to successfully get the bundled version of log4j and Serviio to create the multiple older copies of the serviio.log files upon rollover, then I am suspecting that I might have some sort of environmental issue. Your thoughts?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Jan 12, 2011 10:31 am

Re: Take advantage of advanced Log4J features

wagstaff wrote:If you have been able to successfully get the bundled version of log4j and Serviio to create the multiple older copies of the serviio.log files upon rollover, then I am suspecting that I might have some sort of environmental issue. Your thoughts?


It works for me, but I saw some users complaining too: https://bitbucket.org/xnejp03/serviio/i ... r-properly

What is your OS?
<<

wagstaff

User avatar

Serviio lover

Posts: 52

Joined: Wed Dec 22, 2010 5:35 pm

Location: San Antonio, TX, USA

Post Thu Jan 13, 2011 2:16 am

Re: Take advantage of advanced Log4J features

I am currently running Serviio on a 32-bit version of MS Windows Server 2003 that is up-to-date with all service packs and security patches currently available. I am also running Java v1.6.0_21-b07.
Joe Philipp
Samsung UN46C6900 | Windows Server 2003 SP2 | Mac OS X 10.5.8 | Kubuntu/Ubuntu 11.04

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 14 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.