|
From: Richard P. <Ric...@tu...> - 2007-05-07 16:08:44
|
I wish to change these logs so they roll on a 24 hour basis. Is it possible somebody could send me a sample configuration of how to achieve this.=20 --=20 _________________________________________________________ This communication is intended only for the addressee(s) and may contain = confidential information. We do not waive any confidentiality by misdeliv= ery. If you receive this communication in error, any use, dissemination, = printing or copying is strictly prohibited; please destroy all electronic= and paper copies and notify the sender immediately. |
|
From: Joerg T. <Joe...@ma...> - 2007-05-08 06:57:05
|
On 05/07/07 18:08, Richard Pike wrote:
> I wish to change these logs so they roll on a 24 hour basis. Is it
> possible somebody could send me a sample configuration of how to achieve
> this.
See my previous mail how to use SLF4J. If you choose log4j, you can use the
DailyRollingFileAppender. Just edit the log4j.properties found in your CLASSPATH to contain these lines:
log4j.rootCategory=ALL, Default
log4j.appender.Default=org.apache.log4j.DailyRollingFileAppender
log4j.appender.Default.File=<path of your log file>
log4j.appender.Default.DatePattern=-yyyyMMdd
Note that you can use system properties (e.g. user.home) using the syntax ${user.home}.
Check log4j docs for more details.
Regarding JDK 1.4 java.util.logging, check the docs or ask Tommy, he seems to use that.
Cheers, Jörg
--
Joerg Thoennes
http://www.macd.com Tel.: +49 (0)241 44597-24
Macdonald Associates GmbH Geschäftsführer: Roger Macdonald
Lothringer Str. 52, D-52070 Aachen Amtsgericht Aachen, HRB 8151, Ust.-Id DE813021663
|
|
From: t.s. <tru...@cb...> - 2007-05-29 22:53:47
|
>> I wish to change these logs so they roll on a 24 hour basis. Is it >> possible somebody could send me a sample configuration of how to achieve >> this. > See my previous mail how to use SLF4J. If you choose log4j, you can use the > DailyRollingFileAppender. Just edit the log4j.properties found in your CLASSPATH to contain these lines: > log4j.rootCategory=ALL, Default > log4j.appender.Default=org.apache.log4j.DailyRollingFileAppender > log4j.appender.Default.File=<path of your log file> > log4j.appender.Default.DatePattern=-yyyyMMdd My apologies for resurrecting an old thread, but did anyone had this log4j and DailyRollingFileAppender setup working with QuickFix/J ? I tried it and the log shows on screen, but there are no log files created anywhere... Thanks in advance, t.s. |
|
From: t.s. <tru...@cb...> - 2007-05-30 01:34:17
|
My apologies to the list. My ISP's smtp server seem to be having trouble, so my last email showed up multiple times. Regards, t.s. |
|
From: Toli K. <to...@ma...> - 2007-05-30 01:17:19
|
TS, We are using the RollingFileAppender (almost same as DailyRollingFileAppender). See our example at http://trac.marketcetera.org/trac.fcgi/browser/platform/tags/0.3.1/core/src/main/resources/log4j-appliance.properties Seems like you may have the appender defined, but since everything is showing up on stdout your log4.rootLogger line may not be configured correctly to point to that. Double-check that and you may be able to to get it working. look at the sample file, line 14: it points to file appender, and file is defined above to use RollingFileAppender On 5/29/07, t.s. <tru...@cb...> wrote: > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J Support: http://www.quickfixj.org/support/ > >> I wish to change these logs so they roll on a 24 hour basis. Is it > >> possible somebody could send me a sample configuration of how to achieve > >> this. > > See my previous mail how to use SLF4J. If you choose log4j, you can use the > > DailyRollingFileAppender. Just edit the log4j.properties found in your CLASSPATH to contain these lines: > > log4j.rootCategory=ALL, Default > > log4j.appender.Default=org.apache.log4j.DailyRollingFileAppender > > log4j.appender.Default.File=<path of your log file> > > log4j.appender.Default.DatePattern=-yyyyMMdd > My apologies for resurrecting an old thread, but did anyone had this > log4j and DailyRollingFileAppender setup working with QuickFix/J ? I > tried it and the log shows on screen, but there are no log files created > anywhere... > > Thanks in advance, > t.s. > > > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Quickfixj-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfixj-users > -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |
|
From: Toli K. <to...@ma...> - 2007-05-30 02:32:50
|
These are MINA debug statements. We are seeing these in stdout as well, that's b/c MINA uses either java commons logging or apache commons logging (i believe) so it's not governed by log4j properties file. I tried to get it to output somewhere else with java.util.logging.properties file, but i don't think we ever got it to work. > 04:41:36,250 [AWT-EventQueue-0] INFO events - xxx: Session xxx schedule > is daily, 00:00:00 UTC - 00:00:00 UTC > 04:41:38,406 [QFJ Timer] INFO outgoing - xxx: blah blah blah Otherwise, since you are using SLF4J, check your lib directory. You should have these: slf4j-api-1.3.0.jar slf4j-log4j12-1.3.0.jar If you have anything else, SLF4J may use a different logging provider instead of log4j so that may be why it's not picking up the configs. Also, check your session settings (or your code) and make sure you are only using the SLF4JLogFactory and not ScreenLogFactory - that would also explain what you are seeing. |
|
From: t.s. <tru...@cb...> - 2007-05-29 22:48:29
|
>> I wish to change these logs so they roll on a 24 hour basis. Is it >> possible somebody could send me a sample configuration of how to achieve >> this. > See my previous mail how to use SLF4J. If you choose log4j, you can use the > DailyRollingFileAppender. Just edit the log4j.properties found in your CLASSPATH to contain these lines: > log4j.rootCategory=ALL, Default > log4j.appender.Default=org.apache.log4j.DailyRollingFileAppender > log4j.appender.Default.File=<path of your log file> > log4j.appender.Default.DatePattern=-yyyyMMdd My apologies for resurrecting an old thread, but did anyone had this log4j and DailyRollingFileAppender setup working with QuickFix/J ? I tried it and the log shows on screen, but there are no log files created anywhere... Thanks in advance, t.s. |
|
From: t.s. <tru...@cb...> - 2007-05-30 02:21:11
|
> Seems like you may have the appender defined, but since everything is
> showing up on stdout your log4.rootLogger line may not be configured
> correctly to point to that. Double-check that and you may be able to
> to get it working.
Here's the content of my log4j.properties file:
...
log4j.rootLogger=DEBUG, Default
log4j.appender.Default=org.apache.log4j.DailyRollingFileAppender
log4j.appender.Default.File=/log.txt
log4j.appender.Default.DatePattern='.'yyyy-MM-dd
...
and here's my quickfix config entries:
...
SLF4JLogEventCategory=${senderCompID}.${targetCompID}.events
SLF4JLogIncomingMessageCategory=${senderCompID}.${targetCompID}.incoming
SLF4JLogOutgoingMessageCategory=${senderCompID}.${targetCompID}.outgoing
SLF4JLogPrependSessionID=Y
...
No luck so far.
Something like the following did show up on the console screen
...
04:41:36,250 [AWT-EventQueue-0] INFO events - xxx: Session xxx schedule
is daily, 00:00:00 UTC - 00:00:00 UTC
04:41:36,250 [AWT-EventQueue-0] INFO events - xxx: Created session: xxx
04:41:37,875 [SocketConnectorIoProcessor-0.0] INFO InitiatorIoHandler -
MINA session created: /xxx.xxx.xxx.xxx:xxxx
04:41:38,406 [QFJ Timer] INFO outgoing - xxx: blah blah blah
...
But i didn't even configure a console appender like you did. No log
files created, as far as i can see, and these messages also shows up
even if i delete the log4j.properties file. So maybe quickfix/j (and
log4j) cannot find the file ?
My apologies if this is a log4j question and not a quickfix/j issue.
Regards,
t.s.
|
|
From: t.s. <tru...@cb...> - 2007-05-30 12:02:53
|
> These are MINA debug statements. We are seeing these in stdout as
> well, that's b/c MINA uses either java commons logging or apache
> commons logging (i believe) so it's not governed by log4j properties
> file. I tried to get it to output somewhere else with
> java.util.logging.properties file, but i don't think we ever got it to
> work.
I see. So i shouldn't be worried about those just yet...
>> 04:41:36,250 [AWT-EventQueue-0] INFO events - xxx: Session xxx schedule
>> is daily, 00:00:00 UTC - 00:00:00 UTC
>> 04:41:38,406 [QFJ Timer] INFO outgoing - xxx: blah blah blah
> Otherwise, since you are using SLF4J, check your lib directory. You
> should have these: slf4j-api-1.3.0.jar slf4j-log4j12-1.3.0.jar
Check. Both files are in the lib directory.
> If you have anything else, SLF4J may use a different logging provider
> instead of log4j so that may be why it's not picking up the configs.
Right now my lib directory contains:
quickfixj.jar
backport-util-concurrent-2.1.jar
mina-core-1.0.1-sources.jar
mina-core-1.0.1.jar
slf4j-api-1.3.0.jar
log4j-1-2.4.jar
slf4j-log4j12-1.3.0.jar
> Also, check your session settings (or your code) and make sure you are
> only using the SLF4JLogFactory and not ScreenLogFactory - that would
> also explain what you are seeing.
Check. Here's the code :
...
settings = new SessionSettings(new
FileInputStream(QUICKFIX_CONFIG_FILENAME));
storeFactory = new FileStoreFactory(settings);
messageFactory = new DefaultMessageFactory();
logFactory = new SLF4JLogFactory(settings);
//logFactory = new FileLogFactory(settings);
//logFactory = new ScreenLogFactory(settings);
initiator = new SocketInitiator ( this, storeFactory,
settings, logFactory, messageFactory);
...
quickfix/j config file is like this :
...
SLF4JLogEventCategory=${senderCompID}.${targetCompID}.events
SLF4JLogIncomingMessageCategory=${senderCompID}.${targetCompID}.incoming
SLF4JLogOutgoingMessageCategory=${senderCompID}.${targetCompID}.outgoing
SLF4JLogPrependSessionID=Y
...
I even cleaned out all the references to FileLogXXXXX and ScreenLogXXXX
entries. Still no avail. Just to make sure i'm not barking up the wrong
tree, where *should* one put the slf4j.properties file ?
At this state, i don't even know how to test whether it's working
properly, other than "it doesn't create the log file". Any
pointers/hints will be very much appreciated...
Thank you,
t.s.
|
|
From: Toli K. <to...@ma...> - 2007-05-30 17:55:39
|
> entries. Still no avail. Just to make sure i'm not barking up the wrong > tree, where *should* one put the slf4j.properties file ? > All of your configs look correct. Here are a couple notes, just to be sure: 1. it's log4j.properties not slf4j.properties. it should be anywhere on the classpath. we explicitly add the conf/ directory that has our log4j.properties file to the classpath. You can also just jar it into your app, for example. 2. in the sample log4j.properties file you sent earlier you have the output going to /log.txt. If you are not running the process as root, can it be as simple as not having write permissions? Try just the log4j.appender.Default.File=log.txt to have it print to a local directory first. 3. Also, if nothing is still working, change this line to print to stdout first to see if anything is outputted: log4j.rootLogger=DEBUG,stdout that should give you some Log4J-looking lines (with DEBUG statements) and then you can go debug from there... but otherwise, your setup looks correct. -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |