Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jboss can not recognize custom log4j.properties file

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


That doesn't look right. Try:

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Now my Jboss configuring after putting the line.


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


 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your log4j.properties look like? Maybe you have set logging levels to a very high level.
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my log4j.properties
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you Jaikiran. It is working fine now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic