Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1026229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:03:02+00:00 2026-05-16T12:03:02+00:00

I cannot get the settings in my log4j.properties file to take effect. I’ve already

  • 0

I cannot get the settings in my log4j.properties file to take effect. I’ve already followed the advice in the following forum discussion:

http://community.jboss.org/message/198690#198690

Here is my log4j.properties file (in the root directory of the EAR):

#
# The root logger is set to INFO by default.
# This level can be changed programmatically at runtime.
#
log4j.rootLogger=INFO, stdout, file
# use the hibernate appender for audit logs.
log4j.logger.auditLogger.com.anfscd=INFO, hibernate, HBSS
# Console appender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p %d %c %x - %m %n
log4j.appender.stdout.Threshold=WARN
# Use this ConversionPattern to display thread.
#log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
# Daily rolling file appender.
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.File=c:/anfscd/log/anfscd-server.log
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.layout.ConversionPattern=%-5p %d %c %x - %m %n
# Use this ConversionPattern to display thread.
#log4j.appender.file.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
# Hibernate appender
log4j.appender.hibernate=com.anfscd.common.util.database.log.HibernateAppender
log4j.appender.hibernate.sessionServiceClass=com.anfscd.cmd.model.util.persistence.HibernateHelper
log4j.appender.hibernate.loggingEventClass=com.anfscd.cmd.model.audit.AuditLogRecord
# direct log messages to windows system logs #
log4j.appender.HBSS=org.apache.log4j.nt.NTEventLogAppender
log4j.appender.HBSS.Source=Project Name
log4j.appender.HBSS.layout=org.apache.log4j.PatternLayout
log4j.appender.HBSS.layout.ConversionPattern=%-5p %d %c %x - %m %n
# suppress org.hibernate messages
log4j.logger.org.hibernate=ERROR, stdout

Here is my jboss-app.xml (in [ear]/META-INF):

<?xml version="1.0" encoding="UTF-8"?>
<jboss-app>
  <module-order>strict</module-order>
  <loader-repository>
    com.anfscd:loader=AnfscdLoader
    <loader-repository-config>
      java2ParentDelegation=false
    </loader-repository-config>
  </loader-repository>
</jboss-app>

We’re using Hibernate for persistence, and it is quite verbose in the output console. I don’t want to see Hibernate console output unless there’s an error.

And by the way, I’m using log4j-1.2.15.jar.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:03:02+00:00Added an answer on May 16, 2026 at 12:03 pm

    Wow! Talk about chasing your tail!

    First of all, bottom line, a Log4J running in JBoss 5.x does see and process a log4j.properties file in the root of an EAR.

    … but only if there is nothing else to interfere with it. For instance, if you were to package a log4j.xml in the root of your EAR along with the log4j.properties, Log4J defaults to the .xml file over the .properties file. It loads the configuration from log4j.xml and doesn’t even bother to look for a log4j.properties.

    Alas, that particular scenario was not my problem.

    When it was all said and done, my problem was a 3rd-party JAR that contained its own log4j.properties file. As with the .xml file, if Log4J stumbles across one log4j.properties, it does not bother to look for another one. Well, for whatever reason, in JBoss 4.2.x, Log4J took the log4j.properties in the root of the EAR over the one in the JAR. In contrast, in JBoss 5.x, Log4J took the log4j.properties file in the JAR rather than the one in the root of the EAR.

    I have expunged the log4j.properties file from the 3rd-party JAR, and everything works like a charm.

    I stumbled onto the cause of the problem by enabling Log4J’s debug mode. FYI, you can do this by starting JBoss with the switch -Dlog4j.debug or by setting debug="false" in the log4j:configuration tag in jboss-log4j.xml.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this message: Cannot find the X.509 certificate using the following search criteria:
When I call Response.Redirect(someUrl) I get the following HttpException: Cannot redirect after HTTP headers
I've just started using Log4J for the first time. I created a log4j.properties file
SUMMARY: How to compile in Release mode...I cannot get it to take what I
I cannot get a two-way bind in WPF to work. I have a string
I cannot get the internet explorer web developer tool bar to work with a
I cannot get std::tr1::shared_ptr for my WinMobile project since the STL for WinCE is
For the life of me, I cannot get the SqlProfileProvider to work in an
For some reason, no matter how I go about it, I cannot get TortoiseSVN
I'm terribly new to SQL, and cannot seem to get the desired information out,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.