|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
log4cxx with JNI... Crashes when using appender and layout?When calling native code from java the following works when making the native calls: BasicConfigurator::configure(); LoggerPtr rootLogger = Logger::getRootLogger();
LOG4CXX_DEBUG(rootLogger, "debug message"); LOG4CXX_INFO(rootLogger, "info message"); LOG4CXX_WARN(rootLogger, "warn message"); LOG4CXX_ERROR(rootLogger, "error message"); LOG4CXX_FATAL(rootLogger, "fatal message");
If I try setting appender and layout like:
LoggerPtr rootLogger = Logger::getRootLogger(); log4cxx::ConsoleAppenderPtr appender(new log4cxx::ConsoleAppender()); log4cxx::LayoutPtr layout(new log4cxx::SimpleLayout()); appender->setLayout(layout); log4cxx::helpers::Pool pool; appender->activateOptions(pool); rootLogger->addAppender(appender); LogManager::getLoggerRepository()->setConfigured(true); LOG4CXX_DEBUG(rootLogger, "debug message"); LOG4CXX_INFO(rootLogger, "info message"); LOG4CXX_WARN(rootLogger, "warn message"); LOG4CXX_ERROR(rootLogger, "error message"); LOG4CXX_FATAL(rootLogger, "fatal message");
I get memory could not be “written” Application error and JVM crashes. The messages show up in proper format and all but after that what I get.
Any ideas?
Matt Zmuda Software Developer - Tools Group TVWorks - Platform Division, London, Canada (519) 963-4304
|
|
|
RE: log4cxx with JNI... Crashes when using appender and layout?I wanted to add to this issue. I noticed the error only occurs once the
app finishes running, so probably when the DLL is unloading and there is some
cleaning occurring. Should I be doing any cleanup from the
below code? I didn’t look into it much yet but it seems that all the XxxxxPtr
classes are smart pointers? And from examples I’ve seen there
has been no cleanup. Thanks, Matt Zmuda Software Developer - Tools Group From: Zmuda, Matthew
[mailto:Matthew_Zmuda@...] When
calling native code from java the following works when making the native calls: BasicConfigurator::configure(); LoggerPtr rootLogger =
Logger::getRootLogger(); LOG4CXX_DEBUG(rootLogger, "debug message"); LOG4CXX_INFO(rootLogger, "info message"); LOG4CXX_WARN(rootLogger, "warn message"); LOG4CXX_ERROR(rootLogger, "error message"); LOG4CXX_FATAL(rootLogger, "fatal message"); If I try setting appender and layout like: LoggerPtr rootLogger = Logger::getRootLogger();
log4cxx::ConsoleAppenderPtr appender(new
log4cxx::ConsoleAppender());
log4cxx::LayoutPtr layout(new log4cxx::SimpleLayout()); appender->setLayout(layout);
log4cxx::helpers::Pool pool; appender->activateOptions(pool);
rootLogger->addAppender(appender);
LogManager::getLoggerRepository()->setConfigured(true); LOG4CXX_DEBUG(rootLogger, "debug message"); LOG4CXX_INFO(rootLogger, "info message"); LOG4CXX_WARN(rootLogger, "warn message"); LOG4CXX_ERROR(rootLogger, "error message"); LOG4CXX_FATAL(rootLogger, "fatal message"); I
get memory could not be “written” Application
error and JVM crashes. The messages show up in proper format and all but
after that what I get. Any
ideas? Matt
Zmuda Software
Developer - Tools Group TVWorks
- Platform Division, (519)
963-4304 |
|
|
RE: log4cxx with JNI... Crashes when using appender and layout?Fixed. Was a problem with the built libraries I
was using. I simply rebuilt the project and now work!
Matt Zmuda Software Developer - Tools Group From: Zmuda, Matthew
[mailto:Matthew_Zmuda@...] I wanted to add to this issue. I noticed the error only occurs once the
app finishes running, so probably when the DLL is unloading and there is some
cleaning occurring. Should I be doing any cleanup from the
below code? I didn’t look into it much yet but it seems that all the
XxxxxPtr classes are smart pointers? And from examples I’ve seen there
has been no cleanup. Thanks, Matt Zmuda Software Developer - Tools Group From: Zmuda, Matthew
[mailto:Matthew_Zmuda@...] When
calling native code from java the following works when making the native calls: BasicConfigurator::configure(); LoggerPtr rootLogger =
Logger::getRootLogger(); LOG4CXX_DEBUG(rootLogger, "debug message"); LOG4CXX_INFO(rootLogger, "info message"); LOG4CXX_WARN(rootLogger, "warn message"); LOG4CXX_ERROR(rootLogger, "error message"); LOG4CXX_FATAL(rootLogger, "fatal message"); If I try setting appender and layout like: LoggerPtr rootLogger =
Logger::getRootLogger();
log4cxx::ConsoleAppenderPtr appender(new
log4cxx::ConsoleAppender());
log4cxx::LayoutPtr layout(new log4cxx::SimpleLayout()); appender->setLayout(layout);
log4cxx::helpers::Pool pool; appender->activateOptions(pool);
rootLogger->addAppender(appender);
LogManager::getLoggerRepository()->setConfigured(true); LOG4CXX_DEBUG(rootLogger, "debug message"); LOG4CXX_INFO(rootLogger, "info message"); LOG4CXX_WARN(rootLogger, "warn message"); LOG4CXX_ERROR(rootLogger, "error message"); LOG4CXX_FATAL(rootLogger, "fatal message"); I
get memory could not be “written” Application
error and JVM crashes. The messages show up in proper format and all but
after that what I get. Any
ideas? Matt
Zmuda Software
Developer - Tools Group TVWorks
- Platform Division, (519)
963-4304 |
| Free embeddable forum powered by Nabble | Forum Help |