Yii Framework Forum: Log Settings To Disable Automatic Logging - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Log Settings To Disable Automatic Logging Rate Topic: -----

#1 User is offline   Trejder 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,197
  • Joined: 06-October 10
  • Location:Southern Poland

Posted 08 April 2014 - 07:16 AM

What value should set in levels property of CLogRouter to disable automatic logging of anything? Documentation says, that when levels is empty, everything is logged. How to log nothing?

Why do I need this? I just want to define my log routes, but forbit Yii from logging anything -- I want to have full control over logging process and log only data, that I put through Yii:log() method.
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,359
  • Joined: 12-October 09
  • Location:Croatia

Posted 08 April 2014 - 07:23 AM

How about setting a custom level and use that one in you Yii:log() calls.
Find more about me.... btw. Do you know your WAN IP?
1

#3 User is offline   Trejder 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,197
  • Joined: 06-October 10
  • Location:Southern Poland

Posted 08 April 2014 - 07:59 AM

View PostMaurizio Domba Cerin, on 08 April 2014 - 07:23 AM, said:

How about setting a custom level and use that one in you Yii:log() calls.

That is a reasonable solution.

But it sounds to me like a typical workaround. So, it seems, that scenario like mine, isn't currently handled and -- what do you think about rising an issue to fix this?

IMHO setting levels to empty should handle "my" scenario (do not automatically log anything), while setting it to "all" or "*" should actually log everything.
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
0

#4 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,359
  • Joined: 12-October 09
  • Location:Croatia

Posted 08 April 2014 - 08:05 AM

It's not a workaround it's a solution because to log only "your" calls you still need to set a custom level. If you don't set a custom level, "info" is the default and then the Yii core info messages would be logged too and you don't want that. So in the end you still need to set your custom level in the log() call and in the logger config.
Find more about me.... btw. Do you know your WAN IP?
1

#5 User is offline   Trejder 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,197
  • Joined: 06-October 10
  • Location:Southern Poland

Posted 08 April 2014 - 08:08 AM

Ah, I see. Thanks! :]
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users