I would like to be able to set up logging so that I can log "ALL" to a LuminicBox logger, and "WARNING" to server post logger. This is for all classes, not based on the package/class (or hierarchy, if I understand it correctly).
Loggers in the classes are currently set up:
oLogger:Logger = LogManager.getLogger("com.re.etc.ClassName");
I've tried setting two SimpleHierarchicalLogger's with the appropriate handlers, but can only get a RootLogger to work.
We've been using AS2LIB logging for a while now and is really cool.
Bobby
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you may use the LevelFilterHandler for this purpose.
Add a SimpleHierarchicalLogger instance with name 'com.re' (or something like that) to the logger hierarchy.
The logger instance must be added the LuminicBoxHandler plus the handler that logs to the server. But you do not add the server handler directly, but wrap it with a LevelFilterHandler instance. If you set the filter level to warning, warning, error and fatal messages will get through the filter, all other levels will be filtered out.
Does this serve your needs?
There is currently no support for only allowing one specific message level to go through, but I can easily add this behaviour if you need it.
Greetings,
Simon
PS: Nice to hear that you like as2lib logging. ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, that's great. I hadn't noticed the LevelFilterHandler amongst the other LogHandlers. I'm using the RootLogger rather than the SimpleHierarchicalLogger because I don't really need to control the logging on a class or package level - is that the way to use the RootLogger?
Here's the LevelFilterHandler usage in case anyone else wants it:
var oLuminicHandler:LogHandler = new LuminicBoxHandler();
oLevelFilterHandler = new LevelFilterHandler(oLuminicHandler, AbstractLogLevel.WARNING);
oLogger.addHandler(oLevelFilterHandler);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the RootLogger extends the SimpleHierarchicalLogger which was specifically created to work with the LoggerHierarchy.
If you don't need hierarchy support I suggest you to use the SimpleLogger which is uses log handlers but does not implement the HierarchicalLogger and ConfigurableHierarchicalLogger interfaces. This may save you about 1kb and is also a little faster. ;)
Greetings,
Simon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you give me some basic samples how to use the speed tests testing framework. By now I've used only the unit testing framework in as2lib, and I will find it very usefull if you give me some guidelines on how to do some speed testing too.
Best Regards,
Vladimir
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to be able to set up logging so that I can log "ALL" to a LuminicBox logger, and "WARNING" to server post logger. This is for all classes, not based on the package/class (or hierarchy, if I understand it correctly).
Loggers in the classes are currently set up:
oLogger:Logger = LogManager.getLogger("com.re.etc.ClassName");
I've tried setting two SimpleHierarchicalLogger's with the appropriate handlers, but can only get a RootLogger to work.
We've been using AS2LIB logging for a while now and is really cool.
Bobby
Hi Bobby,
you may use the LevelFilterHandler for this purpose.
Add a SimpleHierarchicalLogger instance with name 'com.re' (or something like that) to the logger hierarchy.
The logger instance must be added the LuminicBoxHandler plus the handler that logs to the server. But you do not add the server handler directly, but wrap it with a LevelFilterHandler instance. If you set the filter level to warning, warning, error and fatal messages will get through the filter, all other levels will be filtered out.
Does this serve your needs?
There is currently no support for only allowing one specific message level to go through, but I can easily add this behaviour if you need it.
Greetings,
Simon
PS: Nice to hear that you like as2lib logging. ;)
Thanks, that's great. I hadn't noticed the LevelFilterHandler amongst the other LogHandlers. I'm using the RootLogger rather than the SimpleHierarchicalLogger because I don't really need to control the logging on a class or package level - is that the way to use the RootLogger?
Here's the LevelFilterHandler usage in case anyone else wants it:
var oLuminicHandler:LogHandler = new LuminicBoxHandler();
oLevelFilterHandler = new LevelFilterHandler(oLuminicHandler, AbstractLogLevel.WARNING);
oLogger.addHandler(oLevelFilterHandler);
Hi Bobby,
the RootLogger extends the SimpleHierarchicalLogger which was specifically created to work with the LoggerHierarchy.
If you don't need hierarchy support I suggest you to use the SimpleLogger which is uses log handlers but does not implement the HierarchicalLogger and ConfigurableHierarchicalLogger interfaces. This may save you about 1kb and is also a little faster. ;)
Greetings,
Simon
Could you give me some basic samples how to use the speed tests testing framework. By now I've used only the unit testing framework in as2lib, and I will find it very usefull if you give me some guidelines on how to do some speed testing too.
Best Regards,
Vladimir