Re: [Openstack-operators] [log] LOG.exception should contain an exception message or not?

2016-01-15 Thread Saverio Proto
I think the stacktrace is usefull when debugging, even as an operator.

Instead of changing the logs to satisfy the tools, it is the tools
that should be enable to parse the logs correctly.

Saverio

2016-01-05 14:08 GMT+01:00 Akihiro Motoki :
> Hi,
>
> # cross-posting to -dev and -operators ML
>
> In the current most OpenStack implementation,
> when we use LOG.exception, we don't pass an exception message to 
> LOG.exception:
>
>   LOG.exception(_LE("Error while processing VIF ports"))
>
> IIUC it is because the exception message will be logged at the end of
> a corresponding stacktrace.
>
> We will get a line like (Full log: http://paste.openstack.org/show/483018/):
>
>   ERROR ... Error while processing VIF ports
>
> [Problem]
>
> Many logging tools are still line-oriented (though logstash or fluentd
> can handle multiple lines).
> An ERROR line only contains a summary message without the actual failure 
> reason.
> This makes difficult for line-oriented logging tools to classify error logs.
>
> [Proposal]
>
> My proposal is to pass an exception message to LOG.exception like:
>
>   except  as exc:
>  LOG.exception(_LE("Error while processing VIF ports: %s"), exc)
>
> This alllows line-oriented logging tools to classify error logs more easily.
>
>
> Thought?
>
> Thanks,
> Akihiro
>
> ___
> OpenStack-operators mailing list
> OpenStack-operators@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

___
OpenStack-operators mailing list
OpenStack-operators@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


Re: [Openstack-operators] [log] LOG.exception should contain an exception message or not?

2016-01-05 Thread Joshua Harlow
Perhaps the recommendation should be to not use line-oriented tools (and 
formatters) for logs? At least at yahoo we use the json formatter 
provided by oslo.log and then use the functionality of splunk to handle 
json records (which afaik is built-in). Likely other tools can also 
handle json records pretty easily/hopefully built-in to.


Then u get nice structured data and other goodies.

-Josh

Akihiro Motoki wrote:

Hi,

# cross-posting to -dev and -operators ML

In the current most OpenStack implementation,
when we use LOG.exception, we don't pass an exception message to LOG.exception:

   LOG.exception(_LE("Error while processing VIF ports"))

IIUC it is because the exception message will be logged at the end of
a corresponding stacktrace.

We will get a line like (Full log: http://paste.openstack.org/show/483018/):

   ERROR ... Error while processing VIF ports

[Problem]

Many logging tools are still line-oriented (though logstash or fluentd
can handle multiple lines).
An ERROR line only contains a summary message without the actual failure reason.
This makes difficult for line-oriented logging tools to classify error logs.

[Proposal]

My proposal is to pass an exception message to LOG.exception like:

   except  as exc:
  LOG.exception(_LE("Error while processing VIF ports: %s"), exc)

This alllows line-oriented logging tools to classify error logs more easily.


Thought?

Thanks,
Akihiro

___
OpenStack-operators mailing list
OpenStack-operators@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


___
OpenStack-operators mailing list
OpenStack-operators@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


[Openstack-operators] [log] LOG.exception should contain an exception message or not?

2016-01-05 Thread Akihiro Motoki
Hi,

# cross-posting to -dev and -operators ML

In the current most OpenStack implementation,
when we use LOG.exception, we don't pass an exception message to LOG.exception:

  LOG.exception(_LE("Error while processing VIF ports"))

IIUC it is because the exception message will be logged at the end of
a corresponding stacktrace.

We will get a line like (Full log: http://paste.openstack.org/show/483018/):

  ERROR ... Error while processing VIF ports

[Problem]

Many logging tools are still line-oriented (though logstash or fluentd
can handle multiple lines).
An ERROR line only contains a summary message without the actual failure reason.
This makes difficult for line-oriented logging tools to classify error logs.

[Proposal]

My proposal is to pass an exception message to LOG.exception like:

  except  as exc:
 LOG.exception(_LE("Error while processing VIF ports: %s"), exc)

This alllows line-oriented logging tools to classify error logs more easily.


Thought?

Thanks,
Akihiro

___
OpenStack-operators mailing list
OpenStack-operators@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators