Search the FirstSpirit Knowledge Base
In FirstSpirit modules, there is a possibility to use module specific logging via:
FileHandle handle = environment.getLogDir().obtain("...");
In cases, where this solution is used, a module specific implementation of:
is requested and needed.
We just wonder, how to integrate a logging framework with the above FirstSpirit FileHandle-object, where only "append" methods are given. For "log4j", individual appenders might be configured, that not necessarily write to a file each. How to combine it with FirstSpirit's "FileHandle" object.
if you need to log a lot and you need a special framework for that for any reason. you have to build your own (Remote)-Logging-Service which logs to the moduls logdir.
if you need no separated log-Files another way is to use de.espirit.common.base.Logging
--
andré
Hi André,
is it a must-have, to integrate a log-framework when using the module specific log directory?
If no, how to log to it? Could you show an pseudo-code?
no, it is not a must have.
if you want to integrate a log framework your self. the way to do this is to write a FS-(Remote)LoggingService-Modul
if you want to use firstSpirit capabilities use the FileHandle which does the remote stuff for you:
final FileHandle handle = _environment.getLogDir().obtain("yourLogFileName.log");
is = new ByteArrayInputStream("[prepend some date...] my log line".getBytes("UTF-8"));
handle.append(is);