0

In my Grails project I've created and implemented log4j logging system. In local environment file is correctly created, but in production server it is not.

here is the log4j configuration inside config.groovy file:

log4j = {

         appenders {        
            file name: 'file', file:"/home/file.log"
            }

         root{
              info 'stdout', 'file'
          }
 }

I've tried with other paths but it does not work.

How can I solve this issue?

FrancescoDS
  • 1,077
  • 4
  • 21
  • 55
  • 1
    Sounds like a permission issue. Make sure whatever account your container (Tomcat perhaps) is running under has permission to write to the target directory on your production server. – Joshua Moore Apr 24 '15 at 10:26
  • I've read the following SO question http://stackoverflow.com/questions/16756995/what-folders-can-my-tomcat-application-write-to-on-ubuntu-server. The user that runs tomcat is root, so I think it has the permission to write the file...is there any other check that I can perform? – FrancescoDS Apr 24 '15 at 11:37
  • how did you check if the user that runs tomcat is root? the link says make sure the tomcat user has the right permission. – dsharew Apr 24 '15 at 11:48
  • if I perform the ps command I see that root is the user that runs tomcat – FrancescoDS Apr 24 '15 at 11:50
  • Notice that, in a controller of my app, I create some folders...so maybe there is some other problem... – FrancescoDS Apr 24 '15 at 11:59
  • Check if you have log4j files in your classpath of your tomcat. – Chris Apr 24 '15 at 14:21
  • @crudolf what do you mean? how can I test if I have log4j files in tomcat classpath? – FrancescoDS Apr 27 '15 at 07:03
  • try to build the war in development mode and deploy it. – Chris Apr 28 '15 at 12:50
  • just to check what the problem might be – Chris Apr 28 '15 at 12:50
  • I've deployed the war but I don't know how to check about the problem – FrancescoDS Jun 09 '15 at 09:35

0 Answers0