This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Jboss can not recognize custom log4j.properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jboss can not recognize custom log4j.properties file" Watch "Jboss can not recognize custom log4j.properties file" New topic
Author

Jboss can not recognize custom log4j.properties file

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
Hi all,

I want my Jboss 4.2 to use a custom log4j.properties file.
For that I have changed the jboss-service.xml file as below:



But at the time of deploying Jboss can not find the file specified(FileNotFoundException).
How can I configure it so that it can find the log4j.properties file anywhere(outside jboss) else?
I am observing only .xml file is being recognized by jboss in above code. If that is the case then how could I make log4j.properties file being recognized by Jboss without keeping it in .ear.

Also I have placed the below code in log4j.properties to generate log file . Is that ok?


Thanks in Advance,
Kousik
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9930
    
159



That doesn't look right. Try:



[My Blog] [JavaRanch Journal]
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
Hello,
Now my Jboss configuring after putting the line.


But is does nothing after that. Jboss just stops after configuring log4j.


Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9930
    
159

What does your log4j.properties look like? Maybe you have set logging levels to a very high level.
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
my log4j.properties
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9930
    
159

log4j.rootLogger=ERROR, console, logfile


Your root logger level is set to ERROR, which means that anything below ERROR level will not be logged, unless you specifically configure individual loggers (like you have done for org.hibernate)

Usually, the root logger is set to INFO levels.
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229

Thank you Jaikiran. It is working fine now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jboss can not recognize custom log4j.properties file
 
Similar Threads
Problem starting JBOSS 4.2.3
problem while starting jboss5.0
JNDI Port number issue while strating JBoss server 4.2.2.GA
Scheduling Tasks in JBoss
Exception while using attribute in tag file