[Jifty-commit] r1811 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Aug 14 08:35:46 EDT 2006


Author: mark
Date: Mon Aug 14 08:35:42 2006
New Revision: 1811

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Logger.pm

Log:
 r1561 at travis:  mark | 2006-08-12 09:36:53 +0100
 improved documentation


Modified: jifty/trunk/lib/Jifty/Logger.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Logger.pm	(original)
+++ jifty/trunk/lib/Jifty/Logger.pm	Mon Aug 14 08:35:42 2006
@@ -9,8 +9,63 @@
 
 =head1 DESCRIPTION
 
-Uses C<Log::Log4perl> to log messages.  By default, logs all messages to
-the screen.
+Jifty uses the Log4perl module to log error messages. In Jifty
+programs there's two ways you can get something logged:
+
+Firstly, Jifty::Logger captures all standard warnings that Perl
+emmits.  So in addtion to everying output from perl via the 
+warnings pragmas, you can also log messages like so:
+
+    warn("The WHAM is overheating!");
+
+This doesn't give you much control however.  The second way
+allows you to specify the level that you want logging to
+occur at:
+
+    Jifty->log->debug("Checking the WHAM");
+    Jifty->log->info("Potential WHAM problem detected");
+    Jifty->log->warn("The WHAM is overheating");
+    Jifty->log->error("PANIC!");
+    Jifty->log->fatal("Someone call Eddie Murphy!");
+
+=head2 Configuring Log4perl
+
+Unless you specify otherwise in the configuration file, Jifty will
+supply a default Log4perl configuration.
+
+The default log configuration that logs all messages to the screen
+(i.e. to STDERR, be that directly to the terminal or to fastcgi's
+log file.)  It will log all messages of equal or higher priority
+to he LogLevel configuration option.
+
+    --- 
+    framework: 
+      LogLevel: DEBUG
+
+You can tell Jifty to use an entirely different Logging
+configuration by specifying the filename of a standard Log4perl
+config file in the LogConfig config option (see L<Log::Log4perl> for
+the format of this config file.)
+
+    --- 
+    framework: 
+      LogConfig: etc/log4perl.conf
+
+Note that specifying your own config file prevents the LogLevel
+config option from having any effect.
+
+You can tell Log4perl to check that file perodically for changes.
+This costs you a little in application performance, but allows
+you to change the logging level of a running application.  You
+need to set LogReload to the frequency, in seconds, that the
+file should be checked.
+
+    --- 
+    framework: 
+      LogConfig: etc/log4perl.conf
+      LogReload: 10
+
+(This is implemented with Log4perl's init_and_watch functionality)
 
 =cut
 
@@ -100,6 +155,8 @@
 
 Various folks at Best Practical Solutions, LLC.
 
+Mark Fowler <mark at twoshortplanks.com> fiddled a bit.
+
 =cut
 
 1;


More information about the Jifty-commit mailing list