[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-user
Subject:    Access logfile logger
From:       JasDA () web ! de
Date:       2009-05-06 6:42:51
Message-ID: 1749404457 () web ! de
[Download RAW message or body]

Hi Heri,

that is exactly I was searching for. Thank you for your advise. It works perfect.

Jason


----------------------------------

You cannot get access to the file object itself for reading purpose because the \
FileAppender uses a FileWriter class for writing to the file. But you can learn the \
file name where the appender writes to. Not each logger instance which you get by \
Logger.getLogger() has appenders attached. Only the logger instances whose name is \
exactly as a configured one have in fact the appenders attached as configured. So, if \
your logger instance has no RollingFileAppender attached, you would have to ask the \
parent logger, and so on, until you find the desired appender. Since the appenders \
instances are singleton, it would be easier to ask the LogManager for all appenders \
and iterate on these to find your desired RollingFileAppender. Once you have found \
the correct appender instance, you cast it and ask it for the file name for use in a \
file reader object. I am not sure about the lock mechanisme applied by a \
RollingFileAppender, if there are any. You have to try. Heri
____________________________________________________________________
Psssst! Schon vom neuen WEB.DE MultiMessenger gehört? 
Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic