summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php
diff options
context:
space:
mode:
authorLasse Birnbaum Jensen <lasse@sdu.dk>2008-06-18 07:46:36 +0000
committerLasse Birnbaum Jensen <lasse@sdu.dk>2008-06-18 07:46:36 +0000
commit5832b4ded69c730cb47284235b4f4a06a30c0804 (patch)
tree67b1f67b8d9add470d1911f005baec5098ab2a1f /lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php
parent238ec6edaede848f12e37508c422948f8dfd5154 (diff)
downloadsimplesamlphp-5832b4ded69c730cb47284235b4f4a06a30c0804.zip
simplesamlphp-5832b4ded69c730cb47284235b4f4a06a30c0804.tar.gz
simplesamlphp-5832b4ded69c730cb47284235b4f4a06a30c0804.tar.bz2
Added options to configure processname for logging. Usefull when having multiple installations on the same machine.
Processname in the log is determined by the 'logging.processname' configuration key. It defaults to "simpleSAMLphp" if not set. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@667 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php')
-rw-r--r--lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php b/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php
index 5ae9ec2..0a9bddb 100644
--- a/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php
+++ b/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php
@@ -23,17 +23,21 @@ class SimpleSAML_Logger_LoggingHandlerErrorLog implements SimpleSAML_Logger_Logg
LOG_NOTICE => 'NOTICE',
LOG_INFO => 'INFO',
LOG_DEBUG => 'DEBUG',
- );
+ );
- function log_internal($level, $string) {
+ function log_internal($level, $string) {
+ $config = SimpleSAML_Configuration::getInstance();
+ assert($config instanceof SimpleSAML_Configuration);
+ $processname = $config->getValue('logging.processname','simpleSAMLphp');
+
if(array_key_exists($level, self::$levelNames)) {
$levelName = self::$levelNames[$level];
} else {
$levelName = sprintf('UNKNOWN%d', $level);
}
- error_log($levelName . ': ' . $string);
+ error_log($processname.' - '.$levelName . ': ' . $string);
}
}