Skip to content
Browse files

Merge pull request #59 from dhaaker/master

Some minor doc fixes
  • Loading branch information...
2 parents 24ec12c + c6e76a3 commit 31c0e6293d5f58b4d63c69e211ae3e1c2aaee4de @willdurand willdurand committed Oct 28, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 documentation/08-logging.markdown
6 documentation/08-logging.markdown
@@ -37,7 +37,7 @@ Using these parameters, Propel creates a `file` Log handler in the background, a
{% highlight php %}
-Propel::$logger = Log::singleton($type = 'file', $name = './propel.log', $ident = 'propel', $conf = array(), $level = PEAR_LOG_DEBUG);
+Propel::setLogger(Log::singleton($type = 'file', $name = './propel.log', $ident = 'propel', $conf = array(), $level = PEAR_LOG_DEBUG));
{% endhighlight %}
The meaning of each of the `<log>` nested elements may vary, depending on which log handler you are using. Most common accepted logger types are `file`, `console`, `syslog`, `display`, `error_log`, `firebug`, and `sqlite`. Refer to the [PEAR::Log]( documentation for more details on log handlers configuration and options.
@@ -63,15 +63,15 @@ Use the static `Propel::log()` method to log a message using the configured log
$myObj = new MyObj();
-Propel::log('uh-oh, something went wrong with ' . $myObj->getName(), Propel::LOG_ERROR);
+Propel::log('uh-oh, something went wrong with ' . $myObj->getName(), Propel::LOG_ERR);
{% endhighlight %}
You can log your own messages from the generated model objects by using their `log()` method, inherited from `BaseObject`:
{% highlight php %}
$myObj = new MyObj();
-$myObj->log('uh-oh, something went wrong', Propel::LOG_ERROR);
+$myObj->log('uh-oh, something went wrong', Propel::LOG_ERR);
{% endhighlight %}
The log messages will show up in the log handler defined in `runtime-conf.xml` (`propel.log` file by default) as follows:

0 comments on commit 31c0e62

Please sign in to comment.
Something went wrong with that request. Please try again.