dynamically set componenet attribute value


In my config/main.php configured component as below.This component will log user activities.



		'class' => 'AppLogger',

		'mLogPath' => '/opt/log/vsdp/ums/',

		'mLogName' => date('Ymd') . '-user.log',

		'mLogType' => 2,

                'mUser => '',



I want to set mUser value after user has logged, and it should be available through out entire session once set within the useActLog object. I can achieve this by saving object to session, but I want to do something like in module init(), for each request module init is called and dynamic params can be set there.How can I do this in main application.



Why do you need to set this in config file? you could retrieve Yii::app()->user inside your logger component in init method or on every log (user could log in/out during request processing)…

Hi red,

Thanks for the response,I don`t want to set it in config file, I mentioned it just to show that attribute of logger component.Yes I can retreive usr from init method as you said. Since "Yii::app()->user" is accessible in every where it is possible.But assume I want to set another attribute value like "mLogType", then what will be the way.This log component is shared among main application and admin module thats why I want to dynamically change the values.