Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to change the name of file in log4j.properties file  RSS feed

 
ajay mittal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am creating an application that needs to be invoked every day. Is there any means in log4j.properties through which i can create the log file for each day seperately.

Secondly, i am passing the name of a file at command line . Is there any means to append this filename with the name of the logfile.

Ajay Mittal
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a DailyRollingFileAppender.
 
ajay mittal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Use a DailyRollingFileAppender.


Thanks a lot, but can you help me to know that how can i append the name of the file passed at cmd prompt to the log file name using log4j.properties.

Ajay Mittal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!