From 31177a68a4d1035f39aba43ab447b63cf0dca6dc Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Fri, 22 Feb 2013 15:16:53 +0100 Subject: [PATCH] Add logging intro, see #2737 (cherry picked from commit 5fcde199d818e22e6dad4aa70f351a52cefe446f) Conflicts: akka-docs/rst/java/logging.rst akka-docs/rst/scala/logging.rst --- akka-docs/rst/java/logging.rst | 15 +++++++++++++-- akka-docs/rst/scala/logging.rst | 18 ++++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/akka-docs/rst/java/logging.rst b/akka-docs/rst/java/logging.rst index 73bd2825eb..af9e8a4a06 100644 --- a/akka-docs/rst/java/logging.rst +++ b/akka-docs/rst/java/logging.rst @@ -4,6 +4,12 @@ Logging (Java) ################ +Logging in Akka is not tied to a specific logging backend. By default +log messages are printed to STDOUT, but you can plug-in a SLF4J logger or +your own logger. Logging is performed asynchronously to ensure that logging +has minimal performance impact. Logging generally means IO and locks, +which can slow down the operations of your code if it was performed +synchronously. How to Log ========== @@ -171,8 +177,13 @@ it to ``OFF`` as well, ensures that nothing gets logged during system startup or Loggers ======= -Logging is performed asynchronously through an event bus. You can configure which loggers that should -subscribe to the logging events. That is done using the 'loggers' element in the :ref:`configuration`. +Logging is performed asynchronously through an event bus. Log events are processed by an event handler actor +and it will receive the log events in the same order as they were emitted. + +One gotcha is that currently the timestamp is attributed in the event handler, not when actually doing the logging. + +You can configure which event handlers are created at system start-up and listen to logging events. That is done using the +``loggers`` element in the :ref:`configuration`. Here you can also define the log level. .. code-block:: ruby diff --git a/akka-docs/rst/scala/logging.rst b/akka-docs/rst/scala/logging.rst index f004770f5c..dfe158dd91 100644 --- a/akka-docs/rst/scala/logging.rst +++ b/akka-docs/rst/scala/logging.rst @@ -4,6 +4,12 @@ Logging (Scala) ################# +Logging in Akka is not tied to a specific logging backend. By default +log messages are printed to STDOUT, but you can plug-in a SLF4J logger or +your own logger. Logging is performed asynchronously to ensure that logging +has minimal performance impact. Logging generally means IO and locks, +which can slow down the operations of your code if it was performed +synchronously. How to Log ========== @@ -214,10 +220,14 @@ it to ``OFF`` as well, ensures that nothing gets logged during system startup or Loggers ======= -Logging is performed asynchronously through an event bus. You can configure -which loggers that should subscribe to the logging events. That is done -using the ``loggers`` element in the :ref:`configuration`. Here you can -also define the log level. +Logging is performed asynchronously through an event bus. Log events are processed by an event handler actor +and it will receive the log events in the same order as they were emitted. + +One gotcha is that currently the timestamp is attributed in the event handler, not when actually doing the logging. + +You can configure which event handlers are created at system start-up and listen to logging events. That is done using the +``loggers`` element in the :ref:`configuration`. +Here you can also define the log level. .. code-block:: ruby