This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes java application cannot found the Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "java application cannot found the" Watch "java application cannot found the" New topic

java application cannot found the

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
The application is a very simple maven application, I put the in resources folder, then I run mvn clean package, then in ecllipse, I right click the project and choose run as java application, but error

No appenders could be found for logger (x.y.TestLog4j)
Please initialize the log4j system properly.

I think the application cannot load the, but how to let the application find the
I check api and there is some
but I do not know how to create the URL. any help is appreciated.

the is as follow:

x=ERROR, A1, A2


log4j.appender.A1.layout.ConversionPattern=%d %-5p (%13F:%L) %3x - %m%n

# Appender A2 writes to the file "test".

# Appender A2 uses the PatternLayout.
log4j.appender.A2.layout.ConversionPattern=%d %-5p [%t] %-17c{2} (%13F:%L) %3x - %m%n

[Thumbnail for Log4j.jpg]

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960

When maven builds the project and you run the target app, the log4j properties file must be in the runtime CLASSPATH at its root. For webapps, that mean in the WEB-INF/classes directory.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: java application cannot found the
Similar Threads
New to log4j concept-log messages are not appending to logfile
creating application log at path specified in Linux
Dukes Bank and log4j error
Log4j logs debug into info...