On Feb 5, 2007, at 6:39 PM, Dion, Gerard (Space Technology) wrote:

Log4J Users:

I exposed the Java Log4J in C++ by Wrapping it with JNI. The interface is C++-ish, not JNI-ish; all JNI jobjects and such returned on JNI calls and such, like the org.apache.log4j.Logger, are wrapped and saved inside my own C++ class instances. So one gets instead an org::apache::log4j::Logger instance for each new call to the Logger interface. Example:


static org::apache::log4j::Logger * newLogger = org::apache::Logger::getLogger(std::string loggerName);


How do I publish this new C++ Log4J Wrapper? It’s only 250 lines of code right now, and yet it handles most of the functionality we need. To support all the functionality of the underlying 32,000 lines of Java log4j code, I believe another 1000 lines of C++ might be required, at most.

From reading the code, it would appear that you would incur a JNI call even when processing log requests that don't satisfy the threshold. Both log4j and log4cxx attempt to make discarded logging requests as cheap as possible so you can feel free to place debug() calls all over your code without worrying about compromising performance.

Could you discuss the motivations behind the your effort?

What would be the relative benefits or disadvantages of:

1. Trying to mimic the log4cxx API
2. Provide an adapter that would allow log4j appenders to be used in log4cxx.

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

Reply via email to