Hello,
I am trying to create custom log levels but I have faced these problems:
1. I am not able to set custom log level from property file, log4cplus crashes (Getting error: log4cplus:ERROR LoggerImpl::getChainedLogLevel()- No valid LogLevel found);
2. If I set custom log level in my program, then log level in log file is named: UNKNOWN;
Info about log4cplus:
Using static library
Version - 1.0.4
Build system - VisualStudio 2010 (project configuration is Debug)
Windows 7 SP1, 64bit
Config file:
log4cplus.rootLogger=TRACE1, Main
log4cplus.appender.Main=log4cplus::RollingFileAppender
log4cplus.appender.Main.File=myLogFile.log
log4cplus.appender.Main.Append=true
log4cplus.appender.Main.MaxFileSize=10MB
log4cplus.appender.Main.MaxBackupIndex=50
log4cplus.appender.Main.layout=log4cplus::PatternLayout
log4cplus.appender.Main.layout.ConversionPattern=%d | [%-7p] | %-20c | %-20m |%n
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
sources how I have created custom log level
I could not reproduce the problem with log4cplus' test cases. But these test cases are using log4cplus as a DLL. Could you try your code with log4cplus as a DLL? Also/alternatively, could you test with the pushToStringMethod() and pushFromStringMethod() calls moved into main()? I suspect this might be an instance of static objects initialization order fiasco problem.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I will try your suggestions next week.
Also I have noticed if log level is misspelled, then log4cplus (static library) crashes with the same error as I have wrote earlier.
Thanks for suggestions.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
You were right about initialization order problem. When I moved calls you specified to main it worked great. I tested on static library.
Thanks for help.
Ticket moved from /p/log4cplus/support-requests/32/