Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log file path in weblogic

 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to have my logs to go to a specific file in prod environment. below is my log4j.xml



the value for param name File is ./log/myapp.log , I did not find myapp.log anywhere in server , please tell me if the configration is right or what is the correct configration ?
 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am not very +ve that ./log/myapp.log refers to somewhere in the root of your application. You can check this by creating a simple txt file at that path and see if it goes somewhere and where. Usually these locations refer to the directory where the serer is running from and operate relative to that instead of the applicatio's root.

Once try by giving an absolute path as the value of File parameter and check if that works. If the absolute path works, the above problem would be confirmed.

Regards
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using an absolute path instead
 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Himanshu Kansal wrote:Hello,

I am not very +ve that ./log/myapp.log refers to somewhere in the root of your application. You can check this by creating a simple txt file at that path and see if it goes somewhere and where. Usually these locations refer to the directory where the serer is running from and operate relative to that instead of the applicatio's root.

Once try by giving an absolute path as the value of File parameter and check if that works. If the absolute path works, the above problem would be confirmed.

Regards


I cannot give absolute path as we don't deploy application we just deliver the ear file and some other firm deploys this and i hvae no knowledge of domain and server etc .Please help me configure log file
 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srini carry wrote: I cannot give absolute path as we don't deploy application we just deliver the ear file and some other firm deploys this and i hvae no knowledge of domain and server etc .Please help me configure log file

ok, so can you run a test locally before delivering it into production? I just want to see the app working with absolute path. To get that, there are some ways.

Also please tell which server would it be deployed on, eg: weblogic, websphere etc and the version.

Regards
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FYI: It depends on the version of log4j whether that "log" directory will be created or not. Looks like that was added to log4j in 1.2.12. Before that it would error out on creating file "./log/myapp.log" if directory log didn't exist.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic