Need to make a log

Did as in this example .

log4j.configuration=file:///${com.sun.aas.instanceRoot}/config/log4j.properties 

On the local machine running. But when I uploaded it to a remote server, it does not record anything in log4j.log or in server.log .

On remote there are several records of Glassfish. I think the problem is this.

Path: /opt/glassfish3/glassfish/domains/domain1

In addition to opt there are a few more directories with glassfish3.

Question: what should be the property?

If the problem is different, then tell me.


The log4j.properties file itself:

 log4j.rootLogger=DEBUG, FILE log4j.logger.myapp=DEBUG log4j.appender.FILE=org.apache.log4j.RollingFileAppender log4j.appender.FILE.File=/opt/glassfish3/glassfish/domains/domain1/logs/log4j.log log4j.appender.FILE.MaxFileSize=1MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.FILE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern=%d{DATE} %-5p %c{1} : %m%n 

I tried to write to server.log - it turned out, but in log4j.log it does not work

  • right enough to write? - etki
  • Sorry, what rights are we talking about? - mr. Ball
  • @ mr.Ball java process to write to /opt/glassfish3/glassfish/domains/domain1/logs/log4j.log - Nofate
  • one
    Most often, writing to the file is not done for the reason that the user who started the process (in your case, the JVM) does not have enough rights to write the specified location of the file system. Check the owner of the directory for the log and make sure that the user, from which the application is launched, has rights to write to this directory. - etki
  • Yes, there are rights to write - mr. Ball

0