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 6358111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:18:20+00:00 2026-05-24T23:18:20+00:00

I cannot get grails log4j logging to work in Tomcat6. I previously thought the

  • 0

I cannot get grails log4j logging to work in Tomcat6. I previously thought the problem had to do with Production mode, but now I believe the issue is tomcat.

I have a log4j configuration in my Config.groovy that correctly sets logging when I run the application in STS. I am using the wonderful app-info plugin, which confirms that the correct logging values are being set.

However, when I do a grails war or even a grails dev war with the same code, and plug it into the webapps folder in Tomcat, no logging happens. When I look in the app-info for logging now, I get a basic log4j.xml which is picking up nothing inside of my configuration. Also, when I look at catalina.out, I see:

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.

For completeness, here is the config that is working correctly in STS, but not when run in Tomcat directly:

log4j = {
    String logDirectory = "${System.getProperty('catalina.base') ?: '.'}/logs"

    appenders {
        console name: "stdout", layout: pattern(conversionPattern: "%d{yyyy-MMM-dd HH:mm:ss,SSS} [%t] %c %x%n %-5p %m%n")
        file name: "errors", file: "pps-errors.log", layout: pattern(conversionPattern: "%d{yyyy-MMM-dd HH:mm:ss,SSS} [%t] %c %x%n %-5p %m%n")
        appender new org.apache.log4j.DailyRollingFileAppender(name:"roll", datePattern: "'.'yyyy-MM-dd", file:"pps-rolling.log", layout: pattern(conversionPattern: "%d{yyyy-MMM-dd HH:mm:ss,SSS} [%t] %c %x%n %-5p %m%n"))
    }


    root { info "stdout", "roll", "errors" }
    // Log all at the error level
    info 'org.apache.',
    'org.tomcat.',
    'grails.app',
    'org.acegisecurity',
    'org.codehaus.groovy.grails.web.servlet', // controllers
    'org.codehaus.groovy.grails.web.pages', // GSP
    'org.codehaus.groovy.grails.web.sitemesh', // layouts
    'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
    'org.codehaus.groovy.grails.web.mapping', // URL mapping
    'org.codehaus.groovy.grails.commons', // core / classloading
    'org.codehaus.groovy.grails.plugins', // plugins
    'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
    'org.springframework',
    'org.hibernate'
    warn 'grails.app'
}

Here is the app-info logging output when this is run in STS:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE log4j:configuration SYSTEM 'log4j.dtd'>

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
   <appender name="stacktraceLog" class="org.apache.log4j.FileAppender">
      <param name="file" value="/home/devon/Documents/SynaSync/Projects/ProjectPointSpread/Source/trunk/target/stacktrace.log"/>
      <param name="name" value="stacktraceLog"/>
      <layout class="org.apache.log4j.PatternLayout">
         <param name="conversionPattern" value="%d [%t] %-5p %c{2} %x - %m%n"/>
      </layout>
   </appender>
   <appender name="roll" class="org.apache.log4j.DailyRollingFileAppender">
      <param name="file" value="pps-rolling.log"/>
      <param name="name" value="roll"/>
      <layout class="org.apache.log4j.PatternLayout">
         <param name="conversionPattern" value="%d{yyyy-MMM-dd HH:mm:ss,SSS} [%t] %c %x%n %-5p %m%n"/>
      </layout>
   </appender>
   <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
      <param name="name" value="stdout"/>
      <layout class="org.apache.log4j.PatternLayout">
         <param name="conversionPattern" value="%d{yyyy-MMM-dd HH:mm:ss,SSS} [%t] %c %x%n %-5p %m%n"/>
      </layout>
   </appender>
   <appender name="errors" class="org.apache.log4j.FileAppender">
      <param name="file" value="pps-errors.log"/>
      <param name="name" value="errors"/>
      <layout class="org.apache.log4j.PatternLayout">
         <param name="conversionPattern" value="%d{yyyy-MMM-dd HH:mm:ss,SSS} [%t] %c %x%n %-5p %m%n"/>
      </layout>
   </appender>
   <logger name="StackTrace" additivity="false">
      <appender-ref ref="stacktraceLog"/>
   </logger>
   <logger name="grails.app">
      <level value="WARN"/>
   </logger>
   <logger name="org.acegisecurity">
      <level value="INFO"/>
   </logger>
   <logger name="org.apache.">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.commons">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.orm.hibernate">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.plugins">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.web.mapping">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.web.mapping.filter">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.web.pages">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.web.servlet">
      <level value="INFO"/>
   </logger>
   <logger name="org.codehaus.groovy.grails.web.sitemesh">
      <level value="INFO"/>
   </logger>
   <logger name="org.hibernate">
      <level value="INFO"/>
   </logger>
   <logger name="org.springframework">
      <level value="INFO"/>
   </logger>
   <logger name="org.tomcat.">
      <level value="INFO"/>
   </logger>
   <root>
      <level value="INFO"/>
      <appender-ref ref="stdout"/>
      <appender-ref ref="roll"/>
      <appender-ref ref="errors"/>
   </root>
</log4j:configuration>

Here is the app-info logging output when run directly in tomcat6:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE log4j:configuration SYSTEM 'log4j.dtd'>

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
   <logger name="Test">
      <level value="ALL"/>
   </logger>
   <root>
      <level value="DEBUG"/>
   </root>
</log4j:configuration>

I am using Grails 1.3.7 if that is helpful.

  • 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-24T23:18:20+00:00Added an answer on May 24, 2026 at 11:18 pm

    It had something to do with a bogus web-inf file that resided from a long time ago. This works correctly when that is not there.

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

Sidebar

Related Questions

I cannot get this to work so I thought it might be a wise
I cannot get this modal dialog to work property. Problem is that in a
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
For the life of me, I cannot get the SqlProfileProvider to work in an
For the life of me I cannot seem to get relationships to work on
I cannot get this crazy dependency to work and please don't tell me to
I cannot get the settings in my log4j.properties file to take effect. I've already
I cannot get ASP .NET MVC 4.0 to work when deployed on IIS 7.5
The following code I cannot get to work (Jquery 1.4.2) It seems like the

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.