
###
Log
###


****
NAME
****


Kernel::System::Log - global log interface


***********
DESCRIPTION
***********


All log functions.


****************
PUBLIC INTERFACE
****************


new()
=====


create a log object. Do not use it directly, instead use:


.. code-block:: perl

     use Kernel::System::ObjectManager;
     local $Kernel::OM = Kernel::System::ObjectManager->new(
         'Kernel::System::Log' => {
             LogPrefix => 'InstallScriptX',  # not required, but highly recommend
         },
     );
     my $LogObject = $Kernel::OM->Get('Kernel::System::Log');



Log()
=====


log something. log priorities are 'debug', 'info', 'notice' and 'error'.

These are mapped to the SysLog priorities. Please use the appropriate priority level:


- debug
 
 Debug-level messages; info useful for debugging the application, not useful during operations.
 


- info
 
 Informational messages; normal operational messages - may be used for reporting etc, no action required.
 


- notice
 
 Normal but significant condition; events that are unusual but not error conditions, no immediate action required.
 


- error
 
 Error conditions. Non-urgent failures, should be relayed to developers or administrators, each item must be resolved.
 


See for more info `http://en.wikipedia.org/wiki/Syslog#Severity_levels <http://en.wikipedia.org/wiki/Syslog#Severity_levels>`_


.. code-block:: perl

     $LogObject->Log(
         Priority => 'error',
         Message  => "Need something!",
     );



Error()
=======


Convenience function to log an error message.


.. code-block:: perl

     $LogObject->Error("Something went wrong!");



Notice()
========


Convenience function to log a notice.


.. code-block:: perl

     $LogObject->Notice("Heads up! SNAFU has happened!");



Info()
======


Convenience function to log an informational message.


.. code-block:: perl

     $LogObject->Info("Oh by the way, this thing worked.");



Debug()
=======


Convenience function to log a message at debug level.


.. code-block:: perl

     $LogObject->Debug("You won't want to see this unless you're a developer.");



GetLogEntry()
=============


to get the last log info back


.. code-block:: perl

     my $Message = $LogObject->GetLogEntry(
         Type => 'error',    # error|info|notice
         What => 'Message',  # Message|Traceback
     );



GetLog()
========


to get the tmp log data (from shared memory - ipc) in csv form


.. code-block:: perl

     my $CSVLog = $LogObject->GetLog();



CleanUp()
=========


to clean up tmp log data from shared memory (ipc)


.. code-block:: perl

     $LogObject->CleanUp();



Dumper()
========


dump a perl variable to log


.. code-block:: perl

     $LogObject->Dumper(@Array);
 
     or
 
     $LogObject->Dumper(%Hash);





