logging.conf.sample 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements. See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License. You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific
  14. #To create separate log levels and log files for different classes and modules,
  15. # user should rename current file to "logging.conf" and restart ambari-agent.
  16. # Before restart, user have to define his own loggers and handlers which be
  17. # logging accordingly their qualname's
  18. # Loggers definitions section.
  19. # root logger definition is mandatory.
  20. # User can define so many loggers as need
  21. # User defined loggers have to described in separate sections e.g. [logger_<logger name>]
  22. [loggers]
  23. keys=root,Controller
  24. # Handlers section defined name of handlers which processed log info
  25. # At least one handler should be defined.
  26. # Settings of user defined have to be done in [handler_<user defined handler name>] section
  27. [handlers]
  28. keys=logfile
  29. # This section defined name of formatters for which use to formate log string
  30. # Format of string have to be defined in [formatter_<formatter name>] section
  31. [formatters]
  32. keys=logfileformatter
  33. # This section is mandatory! This section defined settings for root logge
  34. [logger_root]
  35. level=WARNING
  36. handlers=logfile
  37. # Settings of user defined logger called Controller (this logger added as example)
  38. # level - for this logger can be different from root log level and can be:
  39. # CRITICAL|ERROR|WARNING|INFO|DEBUG
  40. # If level was not defined, by default it will be NOTSET
  41. # handler - name of handler which will be processed log (mandatory)
  42. # qualname - fully qualified name of logger (mandatory)
  43. # Usually qualname of logger defined in code as logger = logging.getLogger(__name__) that the same to file name
  44. [logger_Controller]
  45. level=DEBUG
  46. handlers=logfile
  47. qualname=Controller
  48. # Format of log string definition
  49. [formatter_logfileformatter]
  50. format=%(levelname)s %(asctime)s %(filename)s:%(lineno)d - %(message)s
  51. # Definition of handler for logging
  52. # User can create different type of handlers
  53. [handler_logfile]
  54. class=handlers.RotatingFileHandler
  55. level=DEBUG
  56. args=('/var/log/ambari-agent/ambari-agent.log',"a", 10000000, 25)
  57. formatter=logfileformatter