1

I'm developing web application which has commons-logging.jar and for logging log4j.jar.
I got the following message when server start up.

log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.  

But still log file is created and the format also same as specified in the log4j.properties.
The application log file is creating in Windows environment, But not in Unix environment.
Why it is not creating log file in UNIX ? Folder has write permissions..
Any idea?
Laxman Chowdary

Mr.Chowdary
  • 3,389
  • 9
  • 42
  • 66
  • [Configuration is done here](http://stackoverflow.com/questions/11115141/application-cannot-create-log-file-in-unix) I raised the question with configuration in this.. – Mr.Chowdary Aug 08 '12 at 06:14

1 Answers1

1

The message you get on server startup is just a warning, your log file should be created inspite of it (you can find an explanation for the message in this post).

Why the file is created in Windows but it doesn't get created in Unix could be caused by lots of reasons: permissions for the user under which your application is running are first, maybe the configured path is still a Windows path (e.g. containing C:\ maybe), perhaps you meant to use an absolute path and forgot to prepend the / to it... it's hard to say without seeing your configuration. Check these first and maybe update the question with the configs you are using.

Sometimes what can happen is that you use a relative path for the file and the file gets created relative to some folder in Windows and you expect it to be the same in Unix. But the "current folder" might be another in Unix. Maybe the file gets created but it's located in another place? Try searching for it on disk...

Community
  • 1
  • 1
Bogdan
  • 23,890
  • 3
  • 69
  • 61
  • Hi Bogdan, Thanks for your reply.. Please check my updated code [Here](http://stackoverflow.com/questions/11115141/application-cannot-create-log-file-in-unix) – Mr.Chowdary Aug 08 '12 at 06:16