logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Rosenberger" <pieperm...@gmx.de>
Subject RE: Single logfile per User and Day
Date Tue, 28 Feb 2006 18:23:53 GMT
Hi Heri,

thanks for your advice.

Works fine :-)

Regards,
Christian


> --- Ursprüngliche Nachricht ---
> Von: "Bender Heri" <HBender@Ergonomics.ch>
> An: "Log4J Users List" <log4j-user@logging.apache.org>
> Betreff: RE: Single logfile per User and Day
> Datum: Mon, 27 Feb 2006 16:38:41 +0100
> 
> > Your solution was to implement a custom RepositorySelector, wasn't it?
> 
> Right.
> 
> > What I can't see in your solution was the place where I set 
> > the filename.
> > You've said something about getting the FileAppender?
> > 
> > Can you please explain?
> 
> I assume you configure your log4j framework through property file. 
> 
> Each configured appender and each configured logger will be instantiated
> as singleton. (This is true if you use the default RepositorySelector. If
> you provide a RepositorySelector which maintains different logger
universes,
> these singletons exists in each of these universes once. This is the base
> for supplying each of these different appenders with a separate file
name).
> 
> So you have to fetch a logger to which you have attached - in the config
> file - the desired appender, like:
> 
>     Logger logger = Logger.getLogger( loggername );
> 
> Then you call 
> 
>     DailyRollingFileAppender drfa = ( DailyRollingFileAppender )
> logger.getAppender( appendername );
> 
> And then:
> 
>     drfa.setFile( yourDesiredFileName );
>     drfa.activateOptions(); 
> 
> Heri
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

-- 
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message