Re: logj, EJBs, JBoss revisited (design issues)
Hello and thanks for replying, Well, our design is slightly more complicated, since the logging classes also need database access, and the logging classes in module A uses for example the datasource java:/A, so as the logging part is designed right now you can't view the classes as a library but as an EJB component that is customized for each app it runs with. It's probably a bad design choice and a JBoss issue, after all. [I've written and sent this reply a few days ago, but used Reply to Sender Only, my mistake...] Elias Ross wrote: On Wed, 2003-11-19 at 02:08, Stefan Puiu wrote: The second one is related to finding a different solution using log4j. We needed to have a custom logger for two main reasons: 1) supplementary pattern converters (besides the parameters supported by log4j, we need a supplementary set specific to our app) 2) logging to a database; jdbcAppender is said to be experimental and subject to change in future versions, so we couldn't have used it without risking to have to change the code with newer log4j versions. Can't you just write your own pattern converter and appender and stick only those few (2) classes in a .jar file, deploy them in $JBOSS_DIST/server/default/lib, and _not_ write your own Logger class? Assuming you don't need to change these very often, it may work better to have them static. I'm not sure how reliable it is to have hot-redeployed appenders and pattern converters. People have a difficult enough time as-is without layering on class loading complexity. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
setting up multiple log4j configurations for multiple WAR package s?
Hi all, I'm sorry if this is a FAQ, as I've looked everywhere and can't find very many resources on setting up multiple log4j configurations for different WAR packages (ie. a seperate set of log files for each WAR app). I've tried including a log4j.xml and log4j.blah.jar file with each WAR, but that doesn't seem to work properly. Is there a configuration setting that I'm missing on the servlet container itself? Should the log4j.blah.jar file be in the classpath of the servlet container or remain on the application layer? thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to set log4j.ignoreTCL in XML config file
Hi, I want to use log4j and junit together. I discovered that for this to work I have to set the system property log4j.ignoreTCL=true. When I do this with the -D option it works. Can I set this property in my log4jconfig.xml file as well? And if so, how would I do this. Thanks for your help .. Erwin Kloeck Produktentwicklung Oestreicher + Wagner Medientechnik GmbH Frankenthaler Strasse 20 D-81539 Muenchen Fon +49 (0)89-68961 216 Fax +49 (0)89-68961 271 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: setting up multiple log4j configurations for multiple WAR pac kage s?
IMHO, the simplest and easiest configuration to maintain is to place log4j.jar in WEB-INF/lib and log4j.xml in WEB-INF/classes in each WAR. This should work fine without any additional server configuration. You should not have log4j.jar in your server's classpath or logging won't be separate between webapps. Ken -Original Message- From: Yuzwa, Erik [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 8:30 AM To: 'Log4J Users List' Subject: setting up multiple log4j configurations for multiple WAR package s? Hi all, I'm sorry if this is a FAQ, as I've looked everywhere and can't find very many resources on setting up multiple log4j configurations for different WAR packages (ie. a seperate set of log files for each WAR app). I've tried including a log4j.xml and log4j.blah.jar file with each WAR, but that doesn't seem to work properly. Is there a configuration setting that I'm missing on the servlet container itself? Should the log4j.blah.jar file be in the classpath of the servlet container or remain on the application layer? thanks! - 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]
Problem with adding double quotes in a conversion pattern for PatternLayout specified in an XML configuration
Hi everyone, I have a problem with adding double quotes in a conversion pattern for PatternLayout specified in an XML configuration. Let's see the XML configuration fragment : appender name=AuditActivityFileAppender class=org.apache.log4j.FileAppender param name=File value=${ginko.rootdir.as.file}/logs/audit_activity.log / param name=Appendvalue=true / layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{ISO8601}%m%n/ /layout /appender I would like to surround the date generated by %d{ISO8601} with double quotes like %d{ISO8601}, in order to output 01:15:23 instead of the plain 0115:23 ... BUT XML delimiter is this double quote ! Thus a XML parsing error occurs !! How can I do ? Do you have any escape sequence for the special character , such as %q (like Quote) ? I can't find any solution. Thank you in advance ... Sébastien - An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: setting up multiple log4j configurations for multiple WAR pac kage s?
Hi Ken, Thanks for the reply. That's a good idea, and that should (logically) work. We're using JRun as our servlet engine, and I've discovered that on a global level, it loads up a log4j.properties file which is buried in one of the .jars that ships with the product. This one seems to be trumping all of the ones defined in the WAR packages. I'm attempting to remove it in order to keep the logging at an application level, so we'll see how that goes. I'd also like to ask if there was a way to specify where to dump said log files? If we have multiple WAR packages all configured to use log4j, we'd like them to be dumped at a location of our choosing (rather than a location chosen by the application), for security reasons. Is this possible? ie. maybe setup a global log4j.properties file which defines a filepath for all child log4j.xml objects?? *shrug* IS this even possible? thanks again! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 8:37 AM To: [EMAIL PROTECTED] Subject: RE: setting up multiple log4j configurations for multiple WAR pac kage s? IMHO, the simplest and easiest configuration to maintain is to place log4j.jar in WEB-INF/lib and log4j.xml in WEB-INF/classes in each WAR. This should work fine without any additional server configuration. You should not have log4j.jar in your server's classpath or logging won't be separate between webapps. Ken -Original Message- From: Yuzwa, Erik [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 8:30 AM To: 'Log4J Users List' Subject: setting up multiple log4j configurations for multiple WAR package s? Hi all, I'm sorry if this is a FAQ, as I've looked everywhere and can't find very many resources on setting up multiple log4j configurations for different WAR packages (ie. a seperate set of log files for each WAR app). I've tried including a log4j.xml and log4j.blah.jar file with each WAR, but that doesn't seem to work properly. Is there a configuration setting that I'm missing on the servlet container itself? Should the log4j.blah.jar file be in the classpath of the servlet container or remain on the application layer? thanks! - 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]
Concurrency and performance degradation
Hi, everyone. I'm stress testing a J2EE application and in certain executions (it is not happening always for the same conditions, maybe in 10% of the cases), i have got terrible times for a test case, and when i go and analyze where the most of the time is consumed, i realized that there is at Log4j in Category.info() statements. Our logging strategy is to have a static Logger variable in each class that we want to have logging enabled with the fully qualified class name as the name of the logger. We are using DailyRollingFileAppender and ConsoleAppender to log into a file and into the console output. There is anyway to improve the performance in a concurrency environment (maybe defining a buffer size and have only one thread writing to the file and to the console? ) and prevent this concurrency problems? If, instead of having the logger for each class as a static variable, if i have a Logger instance for each instance of each class (as an instance variable), the performance is improved? Regards, Rui Campos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Concurrency and performance degradation
Howdy, There is anyway to improve the performance in a concurrency environment (maybe defining a buffer size and have only one thread writing to the file and to the console? ) and prevent this concurrency problems? If, instead of having the logger for each class as a static variable, if i have a Logger instance for each instance of each class (as an instance variable), the performance is improved? No, keep one instance per class. Consider using the AsyncAppender or writing a buffered appender like the SMTPAppender. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Concurrency and performance degradation
Hi. Thanks for the reply. What are the implications of using an AsyncAppender? With AsyncAppender don't i have an high probability of get a confused log with lines cutted at half by other lines that are being added? Rui Campos -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: 21 November 2003 16:37 To: Log4J Users List Subject: RE: Concurrency and performance degradation Howdy, There is anyway to improve the performance in a concurrency environment (maybe defining a buffer size and have only one thread writing to the file and to the console? ) and prevent this concurrency problems? If, instead of having the logger for each class as a static variable, if i have a Logger instance for each instance of each class (as an instance variable), the performance is improved? No, keep one instance per class. Consider using the AsyncAppender or writing a buffered appender like the SMTPAppender. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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: Concurrency and performance degradation
Howdy, I don't know, I haven't used it, as I haven't found the need for it. What I do in high-load environment is surround INFO and DEBUG level statements with is-enabled checks (Logger.isDebugEnabled() etc.), which reduces their overhead by nearly 100%. I don't have INFO and DEBUG enabled in production, so I don't suffer from high load at all. Yoav Shapira Millennium ChemInformatics -Original Message- From: Campos Rui Oliveira [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 11:57 AM To: Log4J Users List Subject: RE: Concurrency and performance degradation Hi. Thanks for the reply. What are the implications of using an AsyncAppender? With AsyncAppender don't i have an high probability of get a confused log with lines cutted at half by other lines that are being added? Rui Campos -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: 21 November 2003 16:37 To: Log4J Users List Subject: RE: Concurrency and performance degradation Howdy, There is anyway to improve the performance in a concurrency environment (maybe defining a buffer size and have only one thread writing to the file and to the console? ) and prevent this concurrency problems? If, instead of having the logger for each class as a static variable, if i have a Logger instance for each instance of each class (as an instance variable), the performance is improved? No, keep one instance per class. Consider using the AsyncAppender or writing a buffered appender like the SMTPAppender. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Concurrency and performance degradation
Date: Fri, 21 Nov 2003 18:48:31 +0100 (MET) From: Horst Scheruga [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Concurrency and performance degradation This problem seems very common to me. Costs me 2 days to figure out the trivial and obviousliy reason in my case. I your question I found that you are using a console appender. First remove it and look at the performance again. (Best done by setting the threshold of the appender to WARN or ERROR) If your problem still exists then sorry, I cannot help you. For me the problem was to have the console appender activly logging everything and accessing the Server via a remote tool (VNC). I think LOG4J should have a FAQ and one common question would be Why takes my log-statement so long to execute? The problem I described should be one point of the answer to this question. regards Horst Scheruga -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Concurrency and performance degradation
Howdy Firstly, log4j already has a FAQ, and moreover it's wiki so you can put your money where your mouth is. Secondly, I don't think this is technically a FAQ as it's asked very rarely (about once in six months I think). Yoav Shapira Millennium ChemInformatics -Original Message- From: Horst Scheruga [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 12:53 PM To: [EMAIL PROTECTED] Subject: Re: Concurrency and performance degradation Date: Fri, 21 Nov 2003 18:48:31 +0100 (MET) From: Horst Scheruga [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Concurrency and performance degradation This problem seems very common to me. Costs me 2 days to figure out the trivial and obviousliy reason in my case. I your question I found that you are using a console appender. First remove it and look at the performance again. (Best done by setting the threshold of the appender to WARN or ERROR) If your problem still exists then sorry, I cannot help you. For me the problem was to have the console appender activly logging everything and accessing the Server via a remote tool (VNC). I think LOG4J should have a FAQ and one common question would be Why takes my log-statement so long to execute? The problem I described should be one point of the answer to this question. regards Horst Scheruga -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: setting up multiple log4j configurations for multiple WAR pac kage s?
Does JRun not load from the WebappClassLoader first? Tomcat does this, and I believe the servlet spec defines this behavior (but don't quote me on that). Sounds like the same thing JBoss does by default. The way Tomcat works makes things much easier to work with since libraries in the server won't mess up your webapp which has its own versions locally with the webapp. I'll be JRun can be configured to load from the WebappClassLoader first. Might want to look at see. Otherwise, you can do configuration yourself and use a repository selector from the log4j sandbox. Search the archives and the Wiki for more info on using repository selectors in application servers. Jake At 09:21 AM 11/21/2003 -0700, you wrote: Hi Ken, Thanks for the reply. That's a good idea, and that should (logically) work. We're using JRun as our servlet engine, and I've discovered that on a global level, it loads up a log4j.properties file which is buried in one of the .jars that ships with the product. This one seems to be trumping all of the ones defined in the WAR packages. I'm attempting to remove it in order to keep the logging at an application level, so we'll see how that goes. I'd also like to ask if there was a way to specify where to dump said log files? If we have multiple WAR packages all configured to use log4j, we'd like them to be dumped at a location of our choosing (rather than a location chosen by the application), for security reasons. Is this possible? ie. maybe setup a global log4j.properties file which defines a filepath for all child log4j.xml objects?? *shrug* IS this even possible? thanks again! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 8:37 AM To: [EMAIL PROTECTED] Subject: RE: setting up multiple log4j configurations for multiple WAR pac kage s? IMHO, the simplest and easiest configuration to maintain is to place log4j.jar in WEB-INF/lib and log4j.xml in WEB-INF/classes in each WAR. This should work fine without any additional server configuration. You should not have log4j.jar in your server's classpath or logging won't be separate between webapps. Ken -Original Message- From: Yuzwa, Erik [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 8:30 AM To: 'Log4J Users List' Subject: setting up multiple log4j configurations for multiple WAR package s? Hi all, I'm sorry if this is a FAQ, as I've looked everywhere and can't find very many resources on setting up multiple log4j configurations for different WAR packages (ie. a seperate set of log files for each WAR app). I've tried including a log4j.xml and log4j.blah.jar file with each WAR, but that doesn't seem to work properly. Is there a configuration setting that I'm missing on the servlet container itself? Should the log4j.blah.jar file be in the classpath of the servlet container or remain on the application layer? thanks! - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with adding double quotes in a conversion pattern for PatternLayout specified in an XML configuration
Have you tried quot; Jake At 04:47 PM 11/21/2003 +0100, you wrote: Hi everyone, I have a problem with adding double quotes in a conversion pattern for PatternLayout specified in an XML configuration. Let's see the XML configuration fragment : appender name=AuditActivityFileAppender class=org.apache.log4j.FileAppender param name=File value=${ginko.rootdir.as.file}/logs/audit_activity.log / param name=Appendvalue=true / layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{ISO8601}%m%n/ /layout /appender I would like to surround the date generated by %d{ISO8601} with double quotes like %d{ISO8601}, in order to output 01:15:23 instead of the plain 0115:23 ... BUT XML delimiter is this double quote ! Thus a XML parsing error occurs !! How can I do ? Do you have any escape sequence for the special character , such as %q (like Quote) ? I can't find any solution. Thank you in advance ... Sébastien - An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. - - 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]