It would be great feature to have the option of automatically prefix the session ID to log messages.
It would make the logger a lot more useful since it makes it lot easier to track down bugs and other unusual behavior in the system.
I did take a look at the CLogger and CLogRoute. I don't think it's necessary to prepend this to all log messages in the CLogger since it doesn't change (well, it's not a feature to track changes in the session id).
It would be possible to extend a some log route and do it there, but I think it's such a fundamental thing that it should live in the framework.
It makes it possible to track down what users are doing and what leads to exceptions/bugs/… Without the session it and many users at the same time it makes log hard to follow. It also requires to constantly log redundant information: "$user did this to $that", "$user doing this" "$user stole your beer".
Agree it looks reduntant. But this is the scenario:
Within a day, you get 500 users on your web. Each page view yields 1 'cluster' of log messages. Now one of the users e-mail you and says something is not working on the web. Being a not very computer literate person, he is not very precise on the error message he gets or it's unclear what really happened (we service a lot of people like that)
Now, grepping the logfile by his session it gives you the history of what he's been trying to do. The reason for his problems might have been in previous action (another 'cluster').
I just added CLogRoute::filter and CLogFilter. By setting CLogRoute::filter='CLogFilter' in app config, you may see dump of variables like $_GET, $_POST, etc. You can also configure CLogFilter so that each message is prefixed session ID, user name/ID.