How to exclude a specific warning from log?

How to exclude the follwings warning from log?

2018-01-11 10:16:57 WARNING (Thread-3) [pyW215.pyW215] Failed to open url to 192.168.1.41

2018-01-11 10:17:38 WARNING (Thread-7) [netdisco.ssdp] Error fetching description at https://192.168.1.40/HNAP1/

look into the logger component.

Yes… I’ve already readed this section… but I would want to know if is possible to exclude a specific event not a whole domain or sensor.

default: warning
logs:
  netdisco.ssdp: error
  pyW215.pyW215: error

or whatever level you want to use. You need to set the log level for entities or domains.

2 Likes

Comment it out in the source code is probably the path of least resistance here.

Maybe so but then you’re messing with a lot more than you need to. It’s easier just to define log levels.

Except that he’s asking for how to suppress on a finer grained level than that.

1 Like

didn’t my post do what he was asking or am I missing something?

You’re missing that he is asking to suppress specific messages (only), not classes of them by severity, entity, etc.

1 Like

But why would you want to log everything but the warning log level?

This should be the best option… for the moment the events seem to be disappeared from the log.

You wouldn’t? I don’t know why you’re asking that. But it appears OP’s issue is resolved.

yeah. That wouldn’t make sense. I’m sure you know, but for anyone reading these are the log levels. Why would one want to log info, warn, error, fatal and critical, but not warning?

  • critical
  • fatal
  • error
  • warning
  • warn
  • info
  • debug
  • notset

not to mention, what i posted was what the OP was asking for.

It isn’t, but if OP’s happy with it as close enough, that’s fine.

He’s suppressed all warnings for an entity, as opposed to specific warnings.

The reason you might want to do that is because you’ve confirmed this particular warning is not relevant to your situation.

1 Like

I just do it!