Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails log4J Logging question on linux
    text
    copied!<p>I have been very frustrated about this.</p> <p>I am trying to do the following:</p> <ul> <li>Log all application related logs in application.log that are INFO or above</li> <li>Understand what controls the configuration for catalina.out</li> <li>Log only WARN to catalina.out</li> </ul> <p>I am running my server on ubuntu and I have the default configuration for tomcat which includes a conf directory with a <code>logging.properties</code>. I renamed this file to l.p so it wouldn't conflict. (Not sure if this is a good idea)</p> <p>In my config file, I have:</p> <pre><code>def catalinaBase = System.properties.getProperty('catalina.base') if (!catalinaBase) catalinaBase = '.' // just in case def logDirectory = "${catalinaBase}${File.separator}logs" println "Log Directory: ${logDirectory}" log4j = { appenders { rollingFile name: 'applog', file: "${logDirectory}${File.separator}application.log", layout: pattern(conversionPattern: '%d{dd-MM-yyyy HH:mm:ss,SSS} %5p %c{1} - %m%n'), maxFileSize: 1024 } 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' info applog: 'grails.app' root { info 'applog' } } </code></pre> <p>As a result, I am getting three logs:</p> <pre><code>catalina.2011-01-17.log catalina.out localhost.2011-01-17.log </code></pre> <p>The catalina.out has the following output:</p> <pre><code>Log Directory: /var/lib/tomcat6/logs log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.PropertyUtils). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. log4j:ERROR WARNING: Exception occured configuring log4j logging: Cannot invoke org.apache.log4j.FileAppender.setFile - argument type mismatch </code></pre> <p>I do NOT see the <code>application.log</code> in the log file directory. Any help would be appreciated I am really frustrated about this.</p> <p>One more thing, in windows everything come out to the console and the application.log is created in the <code>.grails\1.3.5\projects\&lt;appnmae&gt;\tomcat</code> directory</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload