Guess this is not his issue!

He needs a system event or trap or signal triggered whenever the ONE 
application creates a new directory or a file in that directory!
That is what I understand when he say's ; Every time we see a new directory, we 
want to create a new logger to put the logs in a new subdirectory.

The event / trap / signal triggered must carry sufficient details such as 
/device/directory/sub-directory or file created/modified/read/deleted 

Now - generating the event / trap / signal is one thing and very OS specific!
As we do not know his OS we can't help here any further.

If we know his OS we might be able to say how write a SECOND detached running 
little application which traps the generated events / traps / signals. 

I did it once for OpenVMS and got events delivered into my AST Routine 
(Asynchronous System Traps) whenever a specific directory or a file in that 
specific directory was touched. This events / traps / signals are needed to be 
delivered by the underlying file system and are then used by the little 
application to generate the loggers and appender's properly.

Josef


-----Ursprüngliche Nachricht-----
Von: Douglas E Wegscheid [mailto:[email protected]] 
Gesendet: Mittwoch, 8. September 2010 14:16
An: Log4J Users List
Cc: [email protected]
Betreff: Re: Dynamic logger configuration

I'm a little confused: do you want to create loggers on the fly, or 
appenders?

creating loggers on the fly: Logger  logger = Logger.getLogger("com.foo");

creating appenders on the fly: 30 seconds with google yielded 
http://robertmaldon.blogspot.com/2007/09/programmatically-configuring-log4j-and.html

Douglas E Wegscheid
Lead Technical Analyst, Whirlpool Corporation
(269)-923-5278

"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."





Chris <[email protected]> 
09/07/2010 04:42 PM
Please respond to
"Log4J Users List" <[email protected]>


To
[email protected]
cc

Subject
Dynamic logger configuration






How can I trap calls to Logger.getLogger() so I can configure each 
logger dynamically?

Our app operates on data in dynamically-created directories. Every time 
we see a new directory, we want to create a new logger to put the logs 
in a new subdirectory. This means that we need a new logger instance for 
each directory, which must have its own FileAppender with the 
appropriate subdirectory name.

The trouble is that I can't configure all of these directory names in 
advance in log4j.properties because I don't know what they will be.




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to