[email protected]
[Top] [All Lists]

Logging to one file per user

Subject: Logging to one file per user
From: fabien JOBIN
Date: Mon, 30 Oct 2006 18:08:09 +0100
Hi,

For a website I need to have a log file per user.

I first looking into NDC by this make only one file with some informations (I 
test with session id).

After I've try to create a file logger and change the name but that doesn't 
work. here's the code :
----------8<-----------
$oUserLogger    = LoggerManager::getLogger('userLog');
$oAppender      = $oUserLogger->getAppender( 'userFile' );
$sLogFile       = sprintf('system/logs/users/%s.log',session_id() );
$oAppender->setFile($sLogFile);

----------8<-----------

So anybody has an idea to make a log file per user ?

Example :
The user bob login and I want him to have the log file logs/users/bob.log
The user dave login and I want him to have the log file logs/users/dave.log

Of course I don't want to create in the config files each log entry but I want to create them dynamiquely (I have hundreds of users).

Hope you can help me.

Best regards,
Fabien

--
ALTAIR Multimédia
RN 147 - Les Petites Buffeteries
49124 Saint Barthélemy d'Anjou
Tél : 02.41.36.86.10
Fax : 02.41.36.86.11
http://www.altair-multimedia.com

<Prev in Thread] Current Thread [Next in Thread>
  • Logging to one file per user, fabien JOBIN <=