Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

logging
 Post subject: logging Post rating: 0   New post Posted: Mon 13 Jul, 2009, 10:09 

User rating: 0
Joined: Thu 02 Jul, 2009, 09:25
Posts: 5
Has anyone successfully integrated log4j in to their strategy code. I keep getting errors when I add an appender. I am particularly interested in adding a custom appender that will append to the jforex console.

any suggestions would be helpful
thanks
Rob


 
 Post subject: Re: logging Post rating: 0   New post Posted: Wed 15 Jul, 2009, 09:18 

User rating: 0
Joined: Thu 02 Jul, 2009, 09:25
Posts: 5
I have found something interesting. When the JForex client is opened the Java console pops up. It displays the usual list of commands and then is closed once the login screen appears. I have integrated Log4j into my code and as a result the logging goes to this console.
It seems there is some implementation of this in the JForex software.
Unfortunately it does not use my log4j.properties file to format the output, or to implement additional appenders. I also cannot seem to add appenders to it. When I use addAppender or getAll Appenders it seems to give me a strange error at run time that these methods do not exist. Which is weird because they are static Logger methods.
This is particularly annoying because I would like to log to a file using log4j. The only sensible way to do that is to use a file appender, but as I can't add one or get it to read my properties file this is proving difficult.
Does anyone have any ideas about this.
Thanks


 
 Post subject: Re: logging Post rating: 0   New post Posted: Wed 15 Jul, 2009, 10:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Don't know any good ideas how to help you with logging through log4j, but can explain error when adding appender. JForex includes log4j-slf4j bridge, which has the same classes as log4j, but redirects all calls to slf4j. That's why it doesn't have methods to work with appenders. slf4j configured to work through java logging, but only messages with INFO and higher priority are enabled in releases of course


 
 Post subject: Re: logging Post rating: 0   New post Posted: Thu 16 Jul, 2009, 12:58 

User rating: 0
Joined: Thu 02 Jul, 2009, 09:25
Posts: 5
So if I understand correctly you can send logging events as if they were log4j events and they will be written to the Java console. However it is not possible to configure the logging any further.
Is there no way I can log to a file without doing it manually?


 
 Post subject: Re: logging Post rating: 0   New post Posted: Thu 16 Jul, 2009, 14:15 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
I don't think it's possible to use log4j for writing to the files right now


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com