You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by rektide <re...@gmail.com> on 2008/07/18 18:42:00 UTC

ALWAYS: Error encountered on logger init:[java.lang.NullPointerException]

No matter what I have in my log4j.properties, I get the following right
after log4j starts:

Error encountered on logger init:[java.lang.NullPointerException]

This is my current log4j.properties file, although I've tried many others:

log4j.rootLogger=FATAL, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

I dont know how to get any useful information about this failure, and I
cannot discern that I am doing anything wrong.  How can I get information
from log4j about its failure, and how can I debug this issue with log4j?
Thus far I've found no way to get any information on this failure, and it
seems like just having a log4j.properties, whether it has contents or no,
causes this problem.

Here's the output leading to this error:

[log.dir.config] not set - looking in [/home/rektide/foo/conf] for logging
configuration
[/home/rektide/foo/conf/log4j.properties] is a valid file location
[/home/rektide/foo/conf/log4j.properties] is a readable file location
Error encountered on logger init:[java.lang.NullPointerException]

-rektide

Re: ALWAYS: Error encountered on logger init:[java.lang.NullPointerException]

Posted by Thorbjørn Ravn Andersen <th...@gmail.com>.
rektide skrev  den 18-07-2008 18:42:
> I dont know how to get any useful information about this failure, and I
> cannot discern that I am doing anything wrong.  How can I get information
> from log4j about its failure, and how can I debug this issue with log4j?
>
>   
The configuration you listed works here in a simple test scenario with 
log4j-1.2.15, so it must be something else.

What version of log4j are you using?

Have you tried setting a break point in the static initializer part in 
org.apache.log4j.LogManager and step through the code?  You may want to 
set the debugger to look for NullPointerExceptions so you can catch it 
immediately. 

-- 
  Thorbjørn




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