log4j

Filtering out log4j messages from third-party frameworks?

How do I filter log messages from external third party frameworks? I am using Hibernate and Spring framework and I would like to suppress the logs so that only my log4j logs appears. ...

Eclipse PDE and log4j.properties?

I have created an eclipse PDE project and have added log4j as a dependency using the slf4j-api and slf4j.log4j12 bundles. In a class I have created the logger: import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MyTest { private static final Logger logger = LoggerFactory.getLogger(MyTest.class .getName()); ...

How to set up DBAppender with log4j in JBoss5?

I would like to be able to set up my clustered JBoss5 instances to write log4j messages to a database. I am trying to use a DBAppender (rather than a JDBCAppender, for the reasons given in this question). Has anyone done this? As of now, I've added an <appender> tag to jboss-log4j.xml and put the logback-classic-0.9.17.jar file in every...

How to write caller location information in a log file using Java, without hurting performance?

Hi folks. How can I write caller location information (Java source file and line), in a log file using Java and log4j, but without hurting performance? log4j allow you to write such information in the log file, but it uses the stack trace to get that it information, every time a log statement is issued, what causes performance degradatio...

Stop Hibernate console output, without log4j

As sad in the title i want to stop Hibernate console output, without using log4j. I have tried to use log4j but i havent got anywhere. What i want is the console INFO outputs to stop. And if i am using log4j is it possible to do it without .properties or .xml files, just set the settings in the source. tnx ...

Log4j SMTPappender error

I am trying to use log4j SMTPappender getting below. error. All other appenders are working fine. <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt; <!-- --> <!-- Declare the SMTPAppender --> <!-- ...

How to install log4jdbc on solr

What is the procedure for installing log4jdbc into Solr? http://code.google.com/p/log4jdbc/ ...

What would be the preferrable way to deploy a grails 1.3.1 based war onto jboss 4.0.5 GA - to avoid errors

I've added the jboss-web.xml file to WEB-INF per http://www.grails.org/FAQand i'm still getting this error: 2010-09-02 12:31:57,920 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable. 2010-09-02 12:31:57,920 ERROR [STDERR] log4j:ERROR The ...

How to include log4j.properties with mvn assembly:assembly?

I want to include a log4j into the package generated by mvn assembly:assembly so that log4j is configured when the generated .jar is executed. How do I do this? My assembly plugin looks like this: <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>ib...

log4j and XML content

I am using log4j to log request/response XMLs sent by my application. The problem is that the xml contents are getting logged with newlines. Any suggestions as to how to format so as to preserve the xml structure as it is received?? Following is my appender: <appender name="xmlFileAppender" class="org.apache.log4j.RollingFileAppender...

Specifying the logging file location in Websphere in a platform-independent way

When using a Log4J RollingFileAppender on Websphere 7.0, how can I specify the location of the logging directory in the log4j.properties file, i.e. pick up Websphere's LOG_ROOT variable? ...

Log4J; how to ensure timestamps are always in GMT using ConversionPattern?

How can I ensure that all timestamps that my log4j is using, are in GMT? I have tried the following but it prints "GMT" inside the timestamp log4j.appender.ConversionPattern=%d{HH\:mm\:ss,SSS}{GMT} %-4r %-5p [%t] %3x - %m%n ...

Hibernate log4j.properties print DB uname & pass

My story is as follows. I have a java app with hibernate connected to a embedded db(derby). The funny thing was, that my hibernate app printed the uname at start, because i was using slf4j-simple, and so i set my App to use log4j. Hibernate db uname&pass are set in code, using property object. I tried using the same trick on log4j prope...

Warning in System.out when an error is logged in a custom log file

Hi all, currently we're running quite a few applications on our WebSphere Portal Server, and most of the have their own log-file, so the System.out won't be too overloaded. However, once an error happens in an application it's easy to miss. If an errors is logged, I would like to get a warning in the System.out with a notice to take a l...

Log4j logging problem with 2 ears in Weblogic

Hi, I'm deploying 2 ears in Weblogic 10, A and B. In both of them I have a "log4j.properties" file. At the startup, when the first ear is loading, the logs are to the right file "A.log", but when the second ear is loading, all logs are going to the "B.log" file, even logs related to the first ear. I missed something... any idea ? Thank...

Requesting newer technologies

Hi there, I'm working on a project which takes use of several technologies: Java JDBC Transaction Isolation Level Java Service Wrapper Log4j Apache Tomcat Webserver BIRT Apache Version Numbering System Apache ANT Build System SOAP The software supports well known databases, such as MSSQL, MySQL, Oracle and DB2. The environment is ...

Grails conversionPattern change at runtime

Hi everyone, Using a standard log4j configuration for my grails app, with a custom conversion pattern like that : log4j = { appenders { console name:'stdout', layout:pattern(conversionPattern: '[%-7p][%d{dd/MM/yyyy HH:mm:ss,SSS}] %C %m%n') } root { warn 'stdout' additivity = true } error 'org.grails.plugins.springsecu...

Log4j category weirdness

I've been having a frustrating time trying to sort out the logging in my project. In particular, one of the 3rd party libraries we use had one class, com.foo.bar.baz.java, that ignored any configuration in the properties file for the com.foo.bar package, instead following the application-wide properties. Eventually using %c in the p...

How to configure log4j to only keep log files for the last seven days?

I have the following logging problem with several Java applications using log4j for logging: I want log files to be rotated daily, like log.2010-09-10 log.2010-09-09 log.2010-09-08 log.2010-09-07 log.2010-09-06 log.2010-09-05 log.2010-09-04 But for data security reasons we are not allowed to keep log files for longer than seven days ...

Log4j SMTPappender with HTML mail

I would like to use log4j and send email in HTML format (Using SMTP Appender). Is it possible in log4j out of the box. If so please point me to right examples ...