KLogger icon indicating copy to clipboard operation
KLogger copied to clipboard

Custom variable

Open eloisance opened this issue 8 years ago • 3 comments

Hi,

I don't understand how to use custom variable?

$logger = new Katzgrau\KLogger\Logger('C:/wamp/www/site/logs', Psr\Log\LogLevel::DEBUG, array(
    'extension' => 'log',
    'logFormat' => '[{date}] [{level}] [$myCustomVar] {message}'
));

and now where i can use it ?

$logger->info('my log');

eloisance avatar Nov 21 '15 16:11 eloisance

Hm, interesting idea, but it's not a supported feature at the moment. You could certainly extend KLogger and override the formatMessage method to achieve that though.

katzgrau avatar Nov 30 '15 23:11 katzgrau

I should add, you would also need to override the info/debug/etc methods

katzgrau avatar Nov 30 '15 23:11 katzgrau

Ok thanks for reply, I will try soon.

eloisance avatar Dec 01 '15 08:12 eloisance