So far I was using Apache Log4Net. To reduce the number of external libs I decided to use the logging built into ServiceStack. But my code-based configuration does not work, there are definitions missing!
I wrote:
public static void InitLogger(Level eventLogLevel, Level logFileLevel, int maxFileSizeInMb, bool filterNh)
{
var hierarchy = (Hierarchy) LogManager.GetRepository();
var topInLogger = LogManager.GetLogger(OpManConstants.LoggerName);
var topInProtocol = LogManager.GetLogger(OpManConstants.ProtLoggerName);
var topInvoiceLogger = (Logger) topInLogger.Logger;
var topInvoiceProtocolLogger = (Logger) topInProtocol.Logger;
//....
}
Level
is unknown and also Hierarchy
and Logger
I have defined a ColoredConsoleAppender
but that one also has a lot of missing definitions, e.g. PatternLayout
, ConversionPattern
, and many more.
Do I have to install Apache Log4Net or do I miss something inside ServiceStack? I executed Install-Package ServiceStack.Logging.Log4Net
.
Also I used to configure Log4Net in Program.cs BEFORE appHost.Init() was called.
Any suggestion?