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

  • Home
  • SEARCH
  • 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 9131957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:13:46+00:00 2026-06-17T08:13:46+00:00

I’m am having trouble logging using my appenders defined on my XML log4j configuration

  • 0

I’m am having trouble logging using my appenders defined on my XML log4j configuration file.

I created the jboss-deployment-structure.xml on my EAR’s META-INF folder with no sucess.

The jboss-deployment-structure.xml structure is:

<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
    <deployment>
        <exclusions>
            <module name="org.apache.log4j" slot="main"/>
        </exclusions>
    </deployment>
</jboss-deployment-structure>

I have even tried to edit my standalone.conf.bat file adding the following line:

set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.as.logging.per-deployment=false"

My application deployment is like this:

-> MyAppEAR.ear
   -> META-INF
      -> MANIFEST.MF
   -> MyAoo.war
      -> META-INF
         -> MANIFEST.MF
         -> jboss-deployment-structure.xml
      -> WEB-INF
         -> web.xml
         -> lib
            -> log4j-1.2.17.jar
            -> ---
         -> classes
            -> log4j.xml
            -> ...

I’ve noticed the following error:

  • jboss-deployment-structure.xml in subdeployment ignored. jboss-deployment-structure.xml is only parsed for top level deployments.

I even tried migrating from JBOSS 7.1.0 to 7.1.1

Some help please!

Thanks


Thanks for the repply James.

I did what you said and moved the jboss-deployment-structure.xml file to MyAppEAR.ear/META-INF.

I’ve noticed that this way the exception:

jboss-deployment-structure.xml in subdeployment ignored. jboss-deployment-structure.xml is only parsed for top level deployments.

… doesn’t occur. I don’t know if that means that the file was parsed… how can I tell?

Despite of this new behaviour my log4j.xml configuration file still isn’t loaded and the logger used still is Log4J’s.

I know this becaused I wrote to the console:

System.out.println(Logger.getRootLogger().getClass().toString())

…and got:

class org.jboss.logmanager.log4j.BridgeLogger

I’ve also tried:

  • moving my log4j.xml to MyAppEAR.ear/META-INF.
  • removing the unecessary -Dorg.jboss.as.logging.per-deployment=false from standalone.conf.bat
  • removing slot from my jboss-deployment-structure.xml

Any more ideas?

Thanks

  • 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-06-17T08:13:47+00:00Added an answer on June 17, 2026 at 8:13 am

    Hi RedEagle see the following configuration which i have tested and its working fine…
    Step-1
    Create a new module as

    jboss-as-7.1.1.Final/modules/com/company/mylog/main/

                              -module.xml
                              -log4j-1.2.14.jar
    
    Content of  module.xml
    
    
     <?xml version="1.0" encoding="UTF-8"?>
          <module xmlns="urn:jboss:module:1.0" name="com.company.mylog">
        <resources>
          <resource-root path="log4j-1.2.14.jar"/>
        </resources>
        <dependencies>
          <module name="javax.api"/>
             </dependencies>
          </module>
    

    Step-2
    Now IN my.ear/META-INF/

              -jboss-deployment-structure.xml
              -MANIFEST.MF
    

    content of jboss-deployment-structure.xml

     <jboss-deployment-structure>
                  <deployment>
    
                      <exclusions>
                      <module name="org.apache.log4j" />
                      </exclusions>
    
                  </deployment>
    
    
                  <sub-deployment name="MyWeb.war">
                        <exclusions>
                        <module name="org.apache.log4j" />
                        </exclusions>
                  </sub-deployment>
    
                  <sub-deployment name="MyBeans.jar">
                    <exclusions>
                      <module name="org.apache.log4j" />
                    </exclusions>
                  </sub-deployment>
    
    
                  </jboss-deployment-structure>
    

    Content of MANIFEST.MF

            Manifest-Version: 1.0
            Dependencies: com.company.mylog
    

    Step-3
    Content of MyLogger.java

    public static Logger getLogger(String name) {
    
        Logger  logger= LogManager.getLogger(name);
        PropertyConfigurator.configure("log4j.properties"); //Path to log4j.properties as many option available in my case for testing i used static path /home/gyani/log4j.properties
        return logger;
    }
    

    Step-4
    Here is log4j.properties

    log4j.rootLogger=info,gyani
    log4j.appender.gyani=org.apache.log4j.RollingFileAppender
    log4j.appender.gyani.File=/home/gyani/myserverlog.log
    log4j.appender.gyani.Append=true
    log4j.appender.gyani.MaxFileSize=100000KB
    log4j.appender.gyani.MaxBackupIndex=10
    log4j.appender.gyani.layout=org.apache.log4j.PatternLayout
    log4j.appender.gyani.layout.ConversionPattern=[%d{MMM d HH:mm:ss yyyy}] [%-5p] [%c]: %m%n
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
In my XML file chapters tag has more chapter tag.i need to display chapters
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm parsing an XML file, the creators of it stuck in a bunch social
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.