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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:15:11+00:00 2026-06-14T10:15:11+00:00

I am trying to create 4 different logs to write to (using Tomcat). Here

  • 0

I am trying to create 4 different logs to write to (using Tomcat). Here is the code (There is some odd stuff because I’m experimenting with it):

log4j = {

    appenders {
        rollingFile  name:'infoLog', file:'/logs/info.log', threshold: org.apache.log4j.Level.INFO
        rollingFile  name:'warnLog', file:'/logs/warn.log', threshold: org.apache.log4j.Level.WARN
        rollingFile  name:'errorLog', file:'/logs/error.log', threshold: org.apache.log4j.Level.ERROR
        rollingFile name:'debugLog', file:'/logs/debug.log', threshold: org.apache.log4j.Level.DEBUG
    }
    root {
        info 'infoLog', 'errorLog', 'warnLog', 'debugLog'
        error 'errorLog'
        warn 'warnLog'
        debug 'debugLog'        
    }

    info 'grails.app'
    error  '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',
           'net.sf.ehcache.hibernate'

    warn   'org.mortbay.log'
    debug 'grails.app'
}

When I deploy and run the app, I get this in catalina.out:

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /logs/info.log (No such file or
directory) at java.io.FileOutputStream.openAppend(Native Method) at
java.io.FileOutputStream.(FileOutputStream.java:177) at
java.io.FileOutputStream.(FileOutputStream.java:102)…

(I get that same message for each log I’m trying to create). Am I missing something?

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-14T10:15:12+00:00Added an answer on June 14, 2026 at 10:15 am

    That particular error message probably means either that the /logs directory does not exist or that it is not writeable by the user ID that your Grails app is running under.

    But more generally, your root logger definition is wrong, you just need one log level (the level you want to use by default for loggers where you don’t specify a more precise rule) attached to all the appenders, e.g.

    root {
        error 'infoLog', 'errorLog', 'warnLog', 'debugLog'
    }
    

    The thresholds of the various appenders will ensure that each gets the right messages: with this configuration debugLog will receive all messages (debug, info, warn and error); infoLog will receive info, warn and error; warnLog will receive warn and error; and errorLog will receive only error messages.

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

Sidebar

Related Questions

I am trying to rewrite some server php code which logs into a website,
I am trying to create two different sets of settings for datepicker( http://keith-wood.name/datepick.html )
I'm trying to create a database with 12 different tables which has been working
I'm trying to create a string that has a set amount of different words
I'm trying to create a simple form with two different submit buttons: one which
I am trying to create an interactive map where users can click on different
Hi i'm trying to create a league table in which i have several different
I'm trying to create a button with a rectangle since we're gonna have different
I'm trying to create a web application using a JavaScript framework (eg Extjs) for
I am trying to create an array with different hrefs to then attach to

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.