• Welcome to KonaKart Community Forum. Please login or sign up.
 

Log4J and Commons Logging

Started by shurdsfield, June 19, 2008, 01:51:54 pm

Previous topic - Next topic

shurdsfield

The KonaKart code uses Common Logging when it accesses a Log object and so should in theory be able to use any logging system.

However the KKEng.java constructor  explictly trys to initialise Log4J and thus bypasses the commons logging mechanism.

I want to be able to use something other than Log4j but i currently cant. This is a problem as my current hosting provider doesnt allow Log4J on the hosting plan im on.

Unfortunately KKEng is not included in the modifiable source. 

Does anyone have any ideas?

nitros

You should be able to use any logging implementation.  Configure your server environment to use the logging implementatio you want.

Even though KKEng.java initializes the logging by reading the konakart-logging.properties,  you can bypass it by creating a blank file konakrt-logging.properties.  Do not delete the file, just keep it blank, it will send all logging to whatever the serveris configured to.

shurdsfield

Well thats what i ended up with and yes, i have used another logging implementation.

However the Hosting privider i use (and admittedly its my fault for using a shared hosting account where i dont have my own server) is funny about people even including log4j jar files or anyone using Log4j classes. 

I have to include Log4j jars as the app wont start without them, and i have a feeling that even doing what you have suggested and i have done would be in breach of their terms.

What id really like is a generic initialisation routine to driven by a config file to point to the implementation.

Cant be that difficult!  Would be nice if the engine was opne source too

nitros

Upon release of 2.2.6, the engine is 100% customizable and I don't see a need to make it open source.  After all somebody has to earn their bread and butter.

I don't know your requirement but we would love to have the client side classes (com.konakart.al.*) open source.

Have you considered moving to a java based hosting company?

mathias.lin

Why is there konakart-logging.properties AND log4j.properties, which actually hold the same content?
Is it because eventually somebody would not use log4j but something else? Where would you configure which logging method to use then?

It's a bit confusing, because I'm usinig log4j and adjusted only the log4j.properties, which didn't seem to have any effect. Then I copied all modifications over to konakart-logging.properties, which then worked fine. So why do I still need the log4j.properties?

kate

The KonaKart engines search for logging properties in files on the classpath in a defined order..

konakart-logging.properties comes before log4j.properties in that search path.

It can sometimes be helpful to have both so that subsystems that only use log4j.properties actually find a logging file that can have a similar logging format to the KonaKart one.  It's up to you...  delete either or both  if you want.

If you want to see what happens just use standard log4j debugging configuration flags to reveal all...   
eg. -Dlog4j.debug=true