Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniform log system #15

Open
zazasa opened this issue Mar 20, 2014 · 5 comments
Open

Uniform log system #15

zazasa opened this issue Mar 20, 2014 · 5 comments

Comments

@zazasa
Copy link
Contributor

zazasa commented Mar 20, 2014

It could be useful to define some rule about log files.
There are 2 main question to define:

1- Log destination (i suggest /var/log/hltd/ )
2- Format:

in my python script i used logging library with this configuration:

logging.basicConfig(filename="/tmp/anelastic.log",
 level=logging.INFO,
 format='%(levelname)s:%(asctime)s-%(name)s.%(funcName)s - %(message)s',
 datefmt='%Y-%m-%d %H:%M:%S')

and each class creates is own logger:

def __init__(self):
 self.logger = logging.getLogger(self.__class__.__name__)

it will result something like this in the log file (type-date-class-function-message):

INFO:2014-03-19 17:51:44-LumiSectionHandler.processDATFile - *message*
@emeschi
Copy link
Contributor

emeschi commented Mar 20, 2014

Hi Salvatore,
I like your proposal and I suggest that you go ahead.
Just one little thing: if we wanted to stash all the logs in elastic search you could look into adding a separate formatter, for example the log stash one http://logstash.net

@mommsen
Copy link
Contributor

mommsen commented Mar 21, 2014

Hi,

I like your proposal. However, we should make sure that there will be a log-rotate active for /var/log/hltd/.

Remi

On 20 Mar 2014, at 17:24, Emilio Meschi [email protected] wrote:

Hi Salvatore,
I like your proposal and I suggest that you go ahead.
Just one little thing: if we wanted to stash all the logs in elastic search you could look into adding a separate formatter, for example the log stash one http://logstash.net


Reply to this email directly or view it on GitHub.

@emeschi
Copy link
Contributor

emeschi commented Mar 21, 2014

There is a logrotate library for python. Can we try and use that?

Sent from my iPhone

On 21 Mar 2014, at 09:21, "mommsen" <[email protected]mailto:[email protected]> wrote:

Hi,

I like your proposal. However, we should make sure that there will be a log-rotate active for /var/log/hltd/.

Remi

On 20 Mar 2014, at 17:24, Emilio Meschi <[email protected]mailto:[email protected]> wrote:

Hi Salvatore,
I like your proposal and I suggest that you go ahead.
Just one little thing: if we wanted to stash all the logs in elastic search you could look into adding a separate formatter, for example the log stash one http://logstash.net


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-38256217.

@zazasa
Copy link
Contributor Author

zazasa commented Mar 21, 2014

It would be simpler to use the OS logrotate system, adding a config script
in /etc/logrotate.d along with the hltd.conf in the rpmbuild.

2014-03-21 9:48 GMT+01:00 Emilio Meschi [email protected]:

There is a logrotate library for python. Can we try and use that?

Sent from my iPhone

On 21 Mar 2014, at 09:21, "mommsen" <[email protected]<mailto:
[email protected]>> wrote:

Hi,

I like your proposal. However, we should make sure that there will be a
log-rotate active for /var/log/hltd/.

Remi

On 20 Mar 2014, at 17:24, Emilio Meschi <[email protected]<mailto:
[email protected]>> wrote:

Hi Salvatore,
I like your proposal and I suggest that you go ahead.
Just one little thing: if we wanted to stash all the logs in elastic
search you could look into adding a separate formatter, for example the log
stash one http://logstash.net

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub<
https://github.com/cmsdaq/hltd/issues/15#issuecomment-38256217>.

Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-38257579
.

@emeschi
Copy link
Contributor

emeschi commented Mar 21, 2014

Very good! I have no strong preference and this way it is probably better integrated with the rest
Emilio

Sent from my iPhone

On 21 Mar 2014, at 11:11, "Salvatore Zaza" <[email protected]mailto:[email protected]> wrote:

It would be simpler to use the OS logrotate system, adding a config script
in /etc/logrotate.d along with the hltd.conf in the rpmbuild.

2014-03-21 9:48 GMT+01:00 Emilio Meschi <[email protected]mailto:[email protected]>:

There is a logrotate library for python. Can we try and use that?

Sent from my iPhone

On 21 Mar 2014, at 09:21, "mommsen" <[email protected]mailto:[email protected]<mailto:
[email protected]mailto:[email protected]>> wrote:

Hi,

I like your proposal. However, we should make sure that there will be a
log-rotate active for /var/log/hltd/.

Remi

On 20 Mar 2014, at 17:24, Emilio Meschi <[email protected]mailto:[email protected]<mailto:
[email protected]mailto:[email protected]>> wrote:

Hi Salvatore,
I like your proposal and I suggest that you go ahead.
Just one little thing: if we wanted to stash all the logs in elastic
search you could look into adding a separate formatter, for example the log
stash one http://logstash.net

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub<
https://github.com/cmsdaq/hltd/issues/15#issuecomment-38256217>.

Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-38257579
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-38262781.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants