diff --git a/library/log4php/layouts/LoggerLayoutSimple.php b/library/log4php/layouts/LoggerLayoutSimple.php new file mode 100644 --- /dev/null +++ b/library/log4php/layouts/LoggerLayoutSimple.php @@ -0,0 +1,56 @@ +level, followed by " - " and then the message. + * + * For example the following php and properties files + * + * {@example ../../examples/php/layout_simple.php 19}
+ * + * {@example ../../examples/resources/layout_simple.properties 18}
+ * + * would result in: + * + * INFO - Hello World! + * + * @version $Revision: 1213283 $ + * @package log4php + * @subpackage layouts + */ +class LoggerLayoutSimple extends LoggerLayout { + /** + * Returns the log statement in a format consisting of the + * level, followed by " - " and then the + * message. For example, + * INFO - "A message" + * + * @param LoggerLoggingEvent $event + * @return string + */ + public function format(LoggerLoggingEvent $event) { + $level = $event->getLevel(); + $message = $event->getRenderedMessage(); + return "$level - $message" . PHP_EOL; + } +}