Re: FileAppender location question

2007-11-05 Thread Bender Heri
In eclipse you can set the working dir in the launch configurations second page 
Arguments.
Heri

 -Original Message-
 From: mbraunwart [mailto:[EMAIL PROTECTED]
 Sent: Friday, November 02, 2007 8:07 PM
 To: log4j-user@logging.apache.org
 Subject: [SPAM (Bayesain Analysis)] - Re: FileAppender 
 location question
 - Bayesian Filter detected spam
 
 
 
 I'm sorry, I don't know where I can set this at in the 
 application, or maybe
 I might not have been clear.  The problem that seems to be 
 the case is that,
 I imported the project into eclipse, but not in my workspace, 
 it stores the
 logs, without a definite path set, to where eclipse is 
 running from, i.e.
 C:\eclipse, even though that is not my workspace.  So I'm not 
 sure where I
 need to fix this.
 
 
 
 James A. N. Stauffer wrote:
  
  The relative path should be from the running working 
 directory so change
  the
  working directory for each program.
  
  On 11/2/07, mbraunwart [EMAIL PROTECTED] wrote:
 
 
  When I started a couple tutorials for Log4J in eclipse, it 
 would store
  the
  file inside of the folder i specified in the root of the 
 project folder
  without having to give it a full path.
 
  This current project that I am working with, taking pretty 
 much the same
  xml
  and idea from the tutorials, I am having a problem to 
 where it wants to
  store my logs in the eclipse program folder, as opposed to 
 the project
  root
  folder.
 
  I have 3 projects set up, one really has nothing to do 
 with the other 2,
  the
  main project where i am gathering my logs is a controller 
 core, and the
  front end is another project that is a j2ee interface 
 which uses the jar
  from the core project.
 
  Right now I have to feed it an exact path name to where I 
 want the logs
  stored, I'd like to figure out the best way to have it store in a
  logs/activity.log from the root of the core project.
 
  I've tried searching for answers to this but I seem to not 
 either be
  using
  the right search criteria, or the answer is out there or 
 I'm overlooking
  it.
  I have a feeling it might be a simple answer and I'm 
 overlooking it, but
  any
  help would be greatly appreciated.
 
  Thank you
 
 
  --
  View this message in context:
  
http://www.nabble.com/FileAppender-location-question-tf4738706.html#a13551552
 Sent from the Log4j - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 -- 
 James A. N. Staufferhttp://www.geocities.com/stauffer_james/
 Are you good? Take the test at http://www.livingwaters.com/good/
 
 

-- 
View this message in context: 
http://www.nabble.com/FileAppender-location-question-tf4738706.html#a13554219
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LOG4J - Different priority messages to different files

2007-11-05 Thread Jimmy Mehta

Hey James,

Thank you so much for your mail...i get your suggestion but i am still not
sure how to attach appender to the Job package or user Package or Address
Package because i know this thing that we can attach appender to the root
category as per example  log4j.rootCategory= console. but how should i
attach appender to individual package. Can you please give me sample code
,it will be appreciated and clear my self.

Jimmy

James A. N. Stauffer wrote:
 
 You shouldn't need to use incorrect levels in your classes.  Just attach
 one
 appender to the Job logger and another appender to the Address and User
 loggers.
 
 On 11/1/07, Jimmy Mehta [EMAIL PROTECTED] wrote:


 Hey James ,

 Thanks for you reply now i find another way that , i have three classes
 Job
 , Address , User. Now i want to put All messages of Job class into
 separate
 file and all Address messages to another file and same as in User. So if
 i
 set priority level in Job class like warn so all fatal , error and warn
 messages of Job class goes to one file and no any other class messages so
 how can i do it with Properties file??

 Can you give me one sample code example so i can understand more
 clearly..

 Appreciate ur help

 Jimmy Mehta

 James A. N. Stauffer wrote:
 
  I find that I want one file for each level and higher.  i.e.
 Warn.loghas
  warn, error, and fatal messages.  That can easily be done by setting
  thresholds on each appender.  If you want only a certain level then you
  can
  use a level match filter but that requires XML config.
 
  On 10/31/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
 
 
  Hi,
 
  I am new to the LOG4J and i am trying to learn so i have a question
 that
  if
  i need to put different priority log messages to different log files.
  Suppose i want to put all warn messages to one file and all info
 messages
  to
  another file and all error messages to another file. My root priority
 is
  Info and I also set different packages to different priority level.
 
  Suppose com.tc.portal.xyz = info so how should i put different
 priority
  messages to different file
 
  Main thing , i want to make only change in log4j.properties file , i
  don't
  want to change java files
 
  Jimmy
  --
  View this message in context:
 
 http://www.nabble.com/LOG4J---Different-priority-messages-to-different-files-tf4728211.html#a13519537
  Sent from the Log4j - Users mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  James A. N. Staufferhttp://www.geocities.com/stauffer_james/
  Are you good? Take the test at http://www.livingwaters.com/good/
 
 

 --
 View this message in context:
 http://www.nabble.com/LOG4J---Different-priority-messages-to-different-files-tf4728211.html#a13535224
 Sent from the Log4j - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 -- 
 James A. N. Staufferhttp://www.geocities.com/stauffer_james/
 Are you good? Take the test at http://www.livingwaters.com/good/
 
 

-- 
View this message in context: 
http://www.nabble.com/LOG4J---Different-priority-messages-to-different-files-tf4728211.html#a13592319
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LOG4J - Different priority messages to different files

2007-11-05 Thread James A. N. Stauffer
http://logging.apache.org/log4j/1.2/manual.html shows an example for the
logger com.foo:

*log4j.logger.com.foo=WARN*


On 11/5/07, Jimmy Mehta [EMAIL PROTECTED] wrote:


 Hey James,

 Thank you so much for your mail...i get your suggestion but i am still not
 sure how to attach appender to the Job package or user Package or Address
 Package because i know this thing that we can attach appender to the root
 category as per example  log4j.rootCategory= console. but how should i
 attach appender to individual package. Can you please give me sample code
 ,it will be appreciated and clear my self.

 Jimmy

 James A. N. Stauffer wrote:
 
  You shouldn't need to use incorrect levels in your classes.  Just attach
  one
  appender to the Job logger and another appender to the Address and User
  loggers.
 
  On 11/1/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
 
 
  Hey James ,
 
  Thanks for you reply now i find another way that , i have three classes
  Job
  , Address , User. Now i want to put All messages of Job class into
  separate
  file and all Address messages to another file and same as in User. So
 if
  i
  set priority level in Job class like warn so all fatal , error and warn
  messages of Job class goes to one file and no any other class messages
 so
  how can i do it with Properties file??
 
  Can you give me one sample code example so i can understand more
  clearly..
 
  Appreciate ur help
 
  Jimmy Mehta
 
  James A. N. Stauffer wrote:
  
   I find that I want one file for each level and higher.  i.e.
  Warn.loghas
   warn, error, and fatal messages.  That can easily be done by setting
   thresholds on each appender.  If you want only a certain level then
 you
   can
   use a level match filter but that requires XML config.
  
   On 10/31/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
  
  
   Hi,
  
   I am new to the LOG4J and i am trying to learn so i have a question
  that
   if
   i need to put different priority log messages to different log
 files.
   Suppose i want to put all warn messages to one file and all info
  messages
   to
   another file and all error messages to another file. My root
 priority
  is
   Info and I also set different packages to different priority level.
  
   Suppose com.tc.portal.xyz = info so how should i put different
  priority
   messages to different file
  
   Main thing , i want to make only change in log4j.properties file , i
   don't
   want to change java files
  
   Jimmy
   --
   View this message in context:
  
 
 http://www.nabble.com/LOG4J---Different-priority-messages-to-different-files-tf4728211.html#a13519537
   Sent from the Log4j - Users mailing list archive at Nabble.com.
  
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
   --
   James A. N. Staufferhttp://www.geocities.com/stauffer_james/
   Are you good? Take the test at http://www.livingwaters.com/good/
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/LOG4J---Different-priority-messages-to-different-files-tf4728211.html#a13535224
  Sent from the Log4j - Users mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  James A. N. Staufferhttp://www.geocities.com/stauffer_james/
  Are you good? Take the test at http://www.livingwaters.com/good/
 
 

 --
 View this message in context:
 http://www.nabble.com/LOG4J---Different-priority-messages-to-different-files-tf4728211.html#a13592319
 Sent from the Log4j - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
James A. N. Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/


Re: LOG4J - Different priority messages to different files

2007-11-05 Thread Jimmy Mehta

Hey James,

Thank you so much and i appreciate your help , i ma playing with
log4j.properties file i didnt touch JAVA file but now i am able to get job
messages to diffrent file and org to different file but now i a facing
problem is that i am not able to set priority properly ,if i am setting
priority on JOB folder = warn but it display info messages also so i am not
able to get only messages that has high priority then warn,

this is my code
# Two appenders , one for file and one for Console
log4j.rootCategory=warn , dest1 , console

log4j.logger.Job = warn , FileAppenderForJob
log4j.logger.User = error , FileAppenderForUser
log4j.logger.Organization = info , FileAppenderForOrganization 


# First Appender writes to the console
log4j.appender.console = org.apache.log4j.ConsoleAppender
log4j.appender.console.layout = org.apache.log4j.PatternLayout

# to display file name and line number
log4j.appender.console.layout.ConversionPattern = %5p [%t] (%F:%L) - %m%n

#Second Appender writes to the File
log4j.appender.dest1 = org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File = example.log
log4j.appender.dest1.MaxFileSize = 100KB
log4j.appender.dest1.MaxBackupIndex = 1
log4j.appender.dest1.layout = org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern= %d %p [%t] (%c) - %m%n

#Appender writes to the JobFile
log4j.appender.FileAppenderForJob = org.apache.log4j.RollingFileAppender
log4j.appender.FileAppenderForJob.File = Job.log
log4j.appender.FileAppenderForJob.MaxFileSize = 100KB
log4j.appender.FileAppenderForJob.MaxBackupIndex = 1
log4j.appender.FileAppenderForJob.layout = org.apache.log4j.PatternLayout
log4j.appender.FileAppenderForJob.layout.ConversionPattern= %d %p [%t] (%c)
- %m%n

#Appender writes to the UserFile
log4j.appender.FileAppenderForUser = org.apache.log4j.RollingFileAppender
log4j.appender.FileAppenderForUser.File = User.log
log4j.appender.FileAppenderForUser.MaxFileSize = 100KB
log4j.appender.FileAppenderForUser.MaxBackupIndex = 1
log4j.appender.FileAppenderForUser.layout = org.apache.log4j.PatternLayout
log4j.appender.FileAppenderForUser.layout.ConversionPattern= %d %p [%t] (%c)
- %m%n

#Appender writes to the OrganizationFile
log4j.appender.FileAppenderForOrganization =
org.apache.log4j.RollingFileAppender
log4j.appender.FileAppenderForOrganization.File = Organization.log
log4j.appender.FileAppenderForOrganization.MaxFileSize = 100KB
log4j.appender.FileAppenderForOrganization.MaxBackupIndex = 1
log4j.appender.FileAppenderForOrganization.layout =
org.apache.log4j.PatternLayout
log4j.appender.FileAppenderForOrganization.layout.ConversionPattern= %d %p
[%t] (%c) - %m%n

So can you please se and tell me whats the problem?

Jimmy

James A. N. Stauffer wrote:
 
 http://logging.apache.org/log4j/1.2/manual.html shows an example for the
 logger com.foo:
 
 *log4j.logger.com.foo=WARN*
 
 
 On 11/5/07, Jimmy Mehta [EMAIL PROTECTED] wrote:


 Hey James,

 Thank you so much for your mail...i get your suggestion but i am still
 not
 sure how to attach appender to the Job package or user Package or Address
 Package because i know this thing that we can attach appender to the root
 category as per example  log4j.rootCategory= console. but how should i
 attach appender to individual package. Can you please give me sample code
 ,it will be appreciated and clear my self.

 Jimmy

 James A. N. Stauffer wrote:
 
  You shouldn't need to use incorrect levels in your classes.  Just
 attach
  one
  appender to the Job logger and another appender to the Address and User
  loggers.
 
  On 11/1/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
 
 
  Hey James ,
 
  Thanks for you reply now i find another way that , i have three
 classes
  Job
  , Address , User. Now i want to put All messages of Job class into
  separate
  file and all Address messages to another file and same as in User. So
 if
  i
  set priority level in Job class like warn so all fatal , error and
 warn
  messages of Job class goes to one file and no any other class messages
 so
  how can i do it with Properties file??
 
  Can you give me one sample code example so i can understand more
  clearly..
 
  Appreciate ur help
 
  Jimmy Mehta
 
  James A. N. Stauffer wrote:
  
   I find that I want one file for each level and higher.  i.e.
  Warn.loghas
   warn, error, and fatal messages.  That can easily be done by setting
   thresholds on each appender.  If you want only a certain level then
 you
   can
   use a level match filter but that requires XML config.
  
   On 10/31/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
  
  
   Hi,
  
   I am new to the LOG4J and i am trying to learn so i have a question
  that
   if
   i need to put different priority log messages to different log
 files.
   Suppose i want to put all warn messages to one file and all info
  messages
   to
   another file and all error messages to another file. My root
 priority
  is
   Info and I also set different packages to different priority level.
  
   

Re: LOG4J - Different priority messages to different files

2007-11-05 Thread James A. N. Stauffer
I don't use a properties config file but that looks correct to me.

On 11/5/07, Jimmy Mehta [EMAIL PROTECTED] wrote:


 Hey James,

 Thank you so much and i appreciate your help , i ma playing with
 log4j.properties file i didnt touch JAVA file but now i am able to get job
 messages to diffrent file and org to different file but now i a facing
 problem is that i am not able to set priority properly ,if i am setting
 priority on JOB folder = warn but it display info messages also so i am
 not
 able to get only messages that has high priority then warn,

 this is my code
 # Two appenders , one for file and one for Console
 log4j.rootCategory=warn , dest1 , console

 log4j.logger.Job = warn , FileAppenderForJob
 log4j.logger.User = error , FileAppenderForUser
 log4j.logger.Organization = info , FileAppenderForOrganization


 # First Appender writes to the console
 log4j.appender.console = org.apache.log4j.ConsoleAppender
 log4j.appender.console.layout = org.apache.log4j.PatternLayout

 # to display file name and line number
 log4j.appender.console.layout.ConversionPattern = %5p [%t] (%F:%L) - %m%n

 #Second Appender writes to the File
 log4j.appender.dest1 = org.apache.log4j.RollingFileAppender
 log4j.appender.dest1.File = example.log
 log4j.appender.dest1.MaxFileSize = 100KB
 log4j.appender.dest1.MaxBackupIndex = 1
 log4j.appender.dest1.layout = org.apache.log4j.PatternLayout
 log4j.appender.dest1.layout.ConversionPattern= %d %p [%t] (%c) - %m%n

 #Appender writes to the JobFile
 log4j.appender.FileAppenderForJob = org.apache.log4j.RollingFileAppender
 log4j.appender.FileAppenderForJob.File = Job.log
 log4j.appender.FileAppenderForJob.MaxFileSize = 100KB
 log4j.appender.FileAppenderForJob.MaxBackupIndex = 1
 log4j.appender.FileAppenderForJob.layout = org.apache.log4j.PatternLayout
 log4j.appender.FileAppenderForJob.layout.ConversionPattern= %d %p [%t]
 (%c)
 - %m%n

 #Appender writes to the UserFile
 log4j.appender.FileAppenderForUser = org.apache.log4j.RollingFileAppender
 log4j.appender.FileAppenderForUser.File = User.log
 log4j.appender.FileAppenderForUser.MaxFileSize = 100KB
 log4j.appender.FileAppenderForUser.MaxBackupIndex = 1
 log4j.appender.FileAppenderForUser.layout = org.apache.log4j.PatternLayout
 log4j.appender.FileAppenderForUser.layout.ConversionPattern= %d %p [%t]
 (%c)
 - %m%n

 #Appender writes to the OrganizationFile
 log4j.appender.FileAppenderForOrganization =
 org.apache.log4j.RollingFileAppender
 log4j.appender.FileAppenderForOrganization.File = Organization.log
 log4j.appender.FileAppenderForOrganization.MaxFileSize = 100KB
 log4j.appender.FileAppenderForOrganization.MaxBackupIndex = 1
 log4j.appender.FileAppenderForOrganization.layout =
 org.apache.log4j.PatternLayout
 log4j.appender.FileAppenderForOrganization.layout.ConversionPattern= %d %p
 [%t] (%c) - %m%n

 So can you please se and tell me whats the problem?

 Jimmy

 James A. N. Stauffer wrote:
 
  http://logging.apache.org/log4j/1.2/manual.html shows an example for the
  logger com.foo:
 
  *log4j.logger.com.foo=WARN*
 
 
  On 11/5/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
 
 
  Hey James,
 
  Thank you so much for your mail...i get your suggestion but i am still
  not
  sure how to attach appender to the Job package or user Package or
 Address
  Package because i know this thing that we can attach appender to the
 root
  category as per example  log4j.rootCategory= console. but how should i
  attach appender to individual package. Can you please give me sample
 code
  ,it will be appreciated and clear my self.
 
  Jimmy
 
  James A. N. Stauffer wrote:
  
   You shouldn't need to use incorrect levels in your classes.  Just
  attach
   one
   appender to the Job logger and another appender to the Address and
 User
   loggers.
  
   On 11/1/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
  
  
   Hey James ,
  
   Thanks for you reply now i find another way that , i have three
  classes
   Job
   , Address , User. Now i want to put All messages of Job class into
   separate
   file and all Address messages to another file and same as in User.
 So
  if
   i
   set priority level in Job class like warn so all fatal , error and
  warn
   messages of Job class goes to one file and no any other class
 messages
  so
   how can i do it with Properties file??
  
   Can you give me one sample code example so i can understand more
   clearly..
  
   Appreciate ur help
  
   Jimmy Mehta
  
   James A. N. Stauffer wrote:
   
I find that I want one file for each level and higher.  i.e.
   Warn.loghas
warn, error, and fatal messages.  That can easily be done by
 setting
thresholds on each appender.  If you want only a certain level
 then
  you
can
use a level match filter but that requires XML config.
   
On 10/31/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
   
   
Hi,
   
I am new to the LOG4J and i am trying to learn so i have a
 question
   that
if
i need to put different priority log messages to different log
 

log.info prints exceptios

2007-11-05 Thread Amnon Lahav
Hi , i've configured a log per level info.log warn.log error.log and put 
them in the correct places (or so i tough) and for some reason info prints 
exceptions allso

log4j.threshold=ALL

log4j.rootLogger= INFO , InfoAppender, WarnAppender,ErrorAppender


log4j.appender.InfoAppender=org.apache.log4j.RollingFileAppender

log4j.appender.InfoAppender.File=info.log

log4j.appender.InfoAppender.MaxFileSize=1MB

log4j.appender.InfoAppender.MaxBackupIndex=3

log4j.appender.InfoAppender.layout=org.apache.log4j.PatternLayout

log4j.appender.InfoAppender.layout.ConversionPattern=%c %M %d{ISO8601} --  
%p -- %m%n


log4j.appender.InfoAppender.Threshold=INFO


log4j.appender.WarnAppender=org.apache.log4j.RollingFileAppender

log4j.appender.WarnAppender.File=warn.log

log4j.appender.WarnAppender.MaxFileSize=1MB

log4j.appender.WarnAppender.MaxBackupIndex=3

log4j.appender.WarnAppender.layout=org.apache.log4j.PatternLayout

log4j.appender.WarnAppender.layout.ConversionPattern=%c %M %d{ISO8601} --  
%p -- %m %n


log4j.appender.WarnAppender.Threshold=WARN


log4j.appender.ErrorAppender=org.apache.log4j.RollingFileAppender

log4j.appender.ErrorAppender.File=error.log

log4j.appender.ErrorAppender.MaxFileSize=1MB

log4j.appender.ErrorAppender.MaxBackupIndex=3

log4j.appender.ErrorAppender.layout=org.apache.log4j.PatternLayout

log4j.appender.ErrorAppender.layout.ConversionPattern=%c %M %d{ISO8601} --  
%p --%m%n


log4j.appender.ErrorAppender.Threshold=ERROR





here is s piece of code for example which i tough should act like i tough 
and it doesn't


try{

logger.info(enter);

if ( genericTradingTimes.isTradingDay()

 !genericTradingTimes.isHoliday(new Date(System.currentTimeMillis()))

 genericTradingTimes.isTradingTime(new Date(System.currentTimeMillis()))

)

{

dataSourceLogic.setUrl(new String[]{});

ListSimplePaperIntraDay list = dataSourceLogic.parseSourceToEntities();

simplePaperIntraDayService.saveNewList(list);

}

logger.info(Exit  );

}

catch (Exception e) {

logger.error(e);

throw new JobExecutionException(e);

}

when exceptions are thrown from within the info try catch they still get 
printed out in the info log and not in the warn , the wanr allso prints them 
but i don't want info.log to do it as well ?


thanks


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LOG4J - Different priority messages to different files

2007-11-05 Thread Jimmy Mehta

hey James,

No prob but i just make some changes in Log4j.properties file and its
working fine now,

Appreciate your help

Jimmy

James A. N. Stauffer wrote:
 
 I don't use a properties config file but that looks correct to me.
 
 On 11/5/07, Jimmy Mehta [EMAIL PROTECTED] wrote:


 Hey James,

 Thank you so much and i appreciate your help , i ma playing with
 log4j.properties file i didnt touch JAVA file but now i am able to get
 job
 messages to diffrent file and org to different file but now i a facing
 problem is that i am not able to set priority properly ,if i am setting
 priority on JOB folder = warn but it display info messages also so i am
 not
 able to get only messages that has high priority then warn,

 this is my code
 # Two appenders , one for file and one for Console
 log4j.rootCategory=warn , dest1 , console

 log4j.logger.Job = warn , FileAppenderForJob
 log4j.logger.User = error , FileAppenderForUser
 log4j.logger.Organization = info , FileAppenderForOrganization


 # First Appender writes to the console
 log4j.appender.console = org.apache.log4j.ConsoleAppender
 log4j.appender.console.layout = org.apache.log4j.PatternLayout

 # to display file name and line number
 log4j.appender.console.layout.ConversionPattern = %5p [%t] (%F:%L) - %m%n

 #Second Appender writes to the File
 log4j.appender.dest1 = org.apache.log4j.RollingFileAppender
 log4j.appender.dest1.File = example.log
 log4j.appender.dest1.MaxFileSize = 100KB
 log4j.appender.dest1.MaxBackupIndex = 1
 log4j.appender.dest1.layout = org.apache.log4j.PatternLayout
 log4j.appender.dest1.layout.ConversionPattern= %d %p [%t] (%c) - %m%n

 #Appender writes to the JobFile
 log4j.appender.FileAppenderForJob = org.apache.log4j.RollingFileAppender
 log4j.appender.FileAppenderForJob.File = Job.log
 log4j.appender.FileAppenderForJob.MaxFileSize = 100KB
 log4j.appender.FileAppenderForJob.MaxBackupIndex = 1
 log4j.appender.FileAppenderForJob.layout = org.apache.log4j.PatternLayout
 log4j.appender.FileAppenderForJob.layout.ConversionPattern= %d %p [%t]
 (%c)
 - %m%n

 #Appender writes to the UserFile
 log4j.appender.FileAppenderForUser = org.apache.log4j.RollingFileAppender
 log4j.appender.FileAppenderForUser.File = User.log
 log4j.appender.FileAppenderForUser.MaxFileSize = 100KB
 log4j.appender.FileAppenderForUser.MaxBackupIndex = 1
 log4j.appender.FileAppenderForUser.layout =
 org.apache.log4j.PatternLayout
 log4j.appender.FileAppenderForUser.layout.ConversionPattern= %d %p [%t]
 (%c)
 - %m%n

 #Appender writes to the OrganizationFile
 log4j.appender.FileAppenderForOrganization =
 org.apache.log4j.RollingFileAppender
 log4j.appender.FileAppenderForOrganization.File = Organization.log
 log4j.appender.FileAppenderForOrganization.MaxFileSize = 100KB
 log4j.appender.FileAppenderForOrganization.MaxBackupIndex = 1
 log4j.appender.FileAppenderForOrganization.layout =
 org.apache.log4j.PatternLayout
 log4j.appender.FileAppenderForOrganization.layout.ConversionPattern= %d
 %p
 [%t] (%c) - %m%n

 So can you please se and tell me whats the problem?

 Jimmy

 James A. N. Stauffer wrote:
 
  http://logging.apache.org/log4j/1.2/manual.html shows an example for
 the
  logger com.foo:
 
  *log4j.logger.com.foo=WARN*
 
 
  On 11/5/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
 
 
  Hey James,
 
  Thank you so much for your mail...i get your suggestion but i am still
  not
  sure how to attach appender to the Job package or user Package or
 Address
  Package because i know this thing that we can attach appender to the
 root
  category as per example  log4j.rootCategory= console. but how should i
  attach appender to individual package. Can you please give me sample
 code
  ,it will be appreciated and clear my self.
 
  Jimmy
 
  James A. N. Stauffer wrote:
  
   You shouldn't need to use incorrect levels in your classes.  Just
  attach
   one
   appender to the Job logger and another appender to the Address and
 User
   loggers.
  
   On 11/1/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
  
  
   Hey James ,
  
   Thanks for you reply now i find another way that , i have three
  classes
   Job
   , Address , User. Now i want to put All messages of Job class into
   separate
   file and all Address messages to another file and same as in User.
 So
  if
   i
   set priority level in Job class like warn so all fatal , error and
  warn
   messages of Job class goes to one file and no any other class
 messages
  so
   how can i do it with Properties file??
  
   Can you give me one sample code example so i can understand more
   clearly..
  
   Appreciate ur help
  
   Jimmy Mehta
  
   James A. N. Stauffer wrote:
   
I find that I want one file for each level and higher.  i.e.
   Warn.loghas
warn, error, and fatal messages.  That can easily be done by
 setting
thresholds on each appender.  If you want only a certain level
 then
  you
can
use a level match filter but that requires XML config.
   
On 10/31/07, Jimmy Mehta [EMAIL PROTECTED] wrote:
   
   

Re: log.info prints exceptios

2007-11-05 Thread Curt Arnold


On Nov 5, 2007, at 4:11 PM, Amnon Lahav wrote:



when exceptions are thrown from within the info try catch they  
still get printed out in the info log and not in the warn , the  
wanr allso prints them but i don't want info.log to do it as well ?





Could you clarify that sentence, I'm not sure what you are trying to  
say.


From your configuration code, you have three log files, info.log,  
warn.log, and error.log.  The info.log file would be expected to have  
any log request of level info and higher, warn.log would have any  
request of level warn and higher and error.log would have any request  
of level error and higher.


You log an exception object as the message for an error level  
request.  The toString() value of the exception would be expected to  
appear in all three files.  The code is legal, any object can be  
passed as a message and have its toString() method called to get the  
message text.  But it is much more common to pass an exception as the  
second arg on a log request like:


logger.error(Exception during data operation, e);

Threshold sets the lower limit of the logging requests processed by  
an appender.  If you want to limit info.log to be only messages with  
the INFO level, you would have to use a filter.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]