1.7 KiB
title |
---|
Logging and History |
DataForge supports two separate logging system:
-
Generic logging system based on
slf4j
on JVM and possibly any other native logging on remote platform. It is used for debugging and online information about the process. Logger could be obtained in any point of the program (e.g. viaLoggerFactrory.getLogger(...)
in JVM). Critical elements and allContextAware
blocks automatically have a pre-defined logger accessible vialogger
property. -
Internal logging utilizes hierarchical structure called
History
. EachHisotory
object has a reference toChronocle
which stores history entries calledRecord
. Also anyHistory
but the root one which isGlobal.history
must have a parentHistory
. AnyRecord
entry appended to the history is automatically appended to its parent with appropriate trace element which specifies where it entry comes from. One can also attach hooks to any chronicle to be triggered on entry addition. Global history logging behavior is controlled viaChronicler
context plugin, which is loaded by default into Global context. History ususally could not be created on sight (only from context chronicler) and should be passed to the process explicitly.
The key difference between logger and history is that logs are intended for debugging and information and are discarded after
being read. The history on the other hand is supposed to be the important part of the analysis and should be stored with
analysis results after it is complete. It is strongly discouraged to use History
in a performance-sensitive code. Also
it is bad idea to output any sensitive information to log since it could be discarded.