Re: Elementary question
Could you not place the configuration file in the root of the /WEB-INF/classes/ ? Log4j will automatically find log4j.xml or log4j.properties if it is located there. Alternatively you could use the Thread.currentThread.getContextClassLoader(), this should work well inside a Webapp. cheers, Paul Smith On Mon, 2003-09-08 at 12:23, Bhamidi Krishna wrote: Hi, I am trying to configure log4j for an app. Currently, I have deployed it on Tomcat. My code snippet is - .. String configFileName = com.common.logger.xml; URL url = null; Context ctx=null; ctx = new InitialContext(); url = ctx.getClass().getResource(configFileName); . I put the xml file under a directory structure under classes in my web-app. The issue is that the URL is null. I also tried other options like making the string \com\common\logger.xml and com\common\logger.xml Another approach I tried was to get Thread.currentThread.getClassLoader and read the URL from there, I get a vague null pointer exception and zip exception. I am sorry if this is a very elementary question, but I could not find any solutions in the lists also. Krishna. - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
conditional second appender
Hi, Is there a way for me to add a conditional second appender? I want to log my data to another log, in addition to the regular log, only when a certain condition is true. I realize I could programatically add an appender when the condition is true. But is that my only option? thanks, Rishi = Yahoo! India Matrimony: Find your partner online. Go to http://yahoo.shaadi.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Bug in JDBCAppender
Ok. Thanks. I'll redefine the execute method in my subclass. I'm using a connection pool, so that would be the way to go. On Fri, 5 Sep 2003 14:23:15 -0700, Charles Hudak wrote: Actually, if you look at the code, the connection is closed in the finalize method, not after every call to the execute method so the connection will only be closed when the object is GC'd. The code is actually fairly fragile in that if the connection times out (and is summarilly closed), the appender will never reopen the connection and all further log events will fail. From the comments, it looks like JDBCAppender is a SIMPLE implementation (read reference implementation) that is designed to be subclassed to provide better functionality (e.g. using connection pooled DataSources in a webapp). -Original Message- From: Milind Rao [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 14:09 To: [EMAIL PROTECTED] Subject: Bug in JDBCAppender There is a bug in JDBCAppender's execute method. If there is a SQLException, the connection is not closed. The best place to close a connection/statement is in finally. What's happening now, is I'm getting a connection leak every time an SQL exception happens. BTW, the log also gets lost. Shouldn't the fallback handler kick in here? Regards Milind - 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] Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LogFactor5 and SocketHubAppender functionality
Hi, Has anyone been successful in getting a SocketHubAppender type solution to work with LogFactor5 in the 1.2.8 release? I'm looking to be able to specify a port on my server that multiple LogFactor5 clients can connect to to receive logging events. From what I can tell, LF5 only works with SocketAppenders -- a pity since I have to create a separate SocketAppender for each machine on which I want to be able to view logging events. In reading posts in the mail archive, it seems that the new Receiver framework should allow the type of behavior that I'm looking for in LF5. However, I'm hoping that I don't have to wait for 1.3.x to get this working. How about it? Anyone gotten this to work in 1.2.8? Thanks, --LB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LogFactor5 and SocketHubAppender functionality
If you don't want to wait for the official release, the HEAD version of Chainsaw v2 supports it via defining it in a log4j configuration file, and we're - - close to tidying up the UI to specify it via the GUI too. cheers, Paul Smith On Tue, 2003-09-09 at 05:22, Lance Birtcil wrote: Hi, Has anyone been successful in getting a SocketHubAppender type solution to work with LogFactor5 in the 1.2.8 release? I'm looking to be able to specify a port on my server that multiple LogFactor5 clients can connect to to receive logging events. From what I can tell, LF5 only works with SocketAppenders -- a pity since I have to create a separate SocketAppender for each machine on which I want to be able to view logging events. In reading posts in the mail archive, it seems that the new Receiver framework should allow the type of behavior that I'm looking for in LF5. However, I'm hoping that I don't have to wait for 1.3.x to get this working. How about it? Anyone gotten this to work in 1.2.8? Thanks, --LB - 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]
RE: LogFactor5 and SocketHubAppender functionality
what about lf5 ? -Mensagem original- De: Paul Smith [mailto:[EMAIL PROTECTED] Enviada: segunda-feira, 8 de Setembro de 2003 22:41 Para: Log4J Users List Assunto: Re: LogFactor5 and SocketHubAppender functionality If you don't want to wait for the official release, the HEAD version of Chainsaw v2 supports it via defining it in a log4j configuration file, and we're - - close to tidying up the UI to specify it via the GUI too. cheers, Paul Smith On Tue, 2003-09-09 at 05:22, Lance Birtcil wrote: Hi, Has anyone been successful in getting a SocketHubAppender type solution to work with LogFactor5 in the 1.2.8 release? I'm looking to be able to specify a port on my server that multiple LogFactor5 clients can connect to to receive logging events. From what I can tell, LF5 only works with SocketAppenders -- a pity since I have to create a separate SocketAppender for each machine on which I want to be able to view logging events. In reading posts in the mail archive, it seems that the new Receiver framework should allow the type of behavior that I'm looking for in LF5. However, I'm hoping that I don't have to wait for 1.3.x to get this working. How about it? Anyone gotten this to work in 1.2.8? Thanks, --LB - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]