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

Unable to output elastalert.log #2510

Closed
negi700 opened this issue Oct 12, 2019 · 1 comment
Closed

Unable to output elastalert.log #2510

negi700 opened this issue Oct 12, 2019 · 1 comment

Comments

@negi700
Copy link

negi700 commented Oct 12, 2019

I set logging, but elastalert.log cannot be output.
I am troubled.
Please tell me the cause and the countermeasure.

The purpose is elastalert log output.
/var/log/elastalert.log

setting

elastalert-config.yamll

#Custom logging configuration
#If you want to setup your own logging configuration to log into
#files as well or to Logstash and/or modify log levels, use
#the configuration below and adjust to your needs.
#Note: if you run ElastAlert with --verbose/--debug, the log level of
#the "elastalert" logger is changed to INFO, if not already INFO/DEBUG.
logging:
  version: 1
  incremental: false
  disable_existing_loggers: false
  formatters:
    logline:
      format: '%(asctime)s %(levelname)+8s %(name)+20s %(message)s'

    handlers:
      console:
        class: logging.StreamHandler
        formatter: logline
        level: DEBUG
        stream: ext://sys.stderr

      file:
        class : logging.FileHandler
        formatter: logline
        level: DEBUG
        filename: /var/log/elastalert.log

    loggers:
      elastalert:
        level: WARN
        handlers: []
        propagate: true

      elasticsearch:
        level: WARN
        handlers: []
        propagate: true

      elasticsearch.trace:
        level: WARN
        handlers: []
        propagate: true

      '':  # root logger
        level: WARN
        handlers:
          - console
          - file
        propagate: false
@negi700 negi700 changed the title About logging settings Unable to output elastalert.log Oct 12, 2019
@negi700
Copy link
Author

negi700 commented Dec 10, 2019

Solved.
When config.yaml was modified, log output was possible.

Correction points

config.yaml

before
     '':  # root logger
       level: WARN
         handlers:
           - console
           - file
       propagate: false

after
      '':  # root logger
        level: WARN
        handlers:
          - console
          - file
        propagate: false

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

1 participant