Guest User

/etc/cloud/cloud.cfg.d/05_logging.cfg

a guest
Apr 30th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. ## This yaml formated config file handles setting
  2. ## logger information. The values that are necessary to be set
  3. ## are seen at the bottom. The top '_log' are only used to remove
  4. ## redundency in a syslog and fallback-to-file case.
  5. ##
  6. ## The 'log_cfgs' entry defines a list of logger configs
  7. ## Each entry in the list is tried, and the first one that
  8. ## works is used. If a log_cfg list entry is an array, it will
  9. ## be joined with '\n'.
  10. _log:
  11. - &log_base |
  12. [loggers]
  13. keys=root,cloudinit
  14.  
  15. [handlers]
  16. keys=consoleHandler,cloudLogHandler
  17.  
  18. [formatters]
  19. keys=simpleFormatter,arg0Formatter
  20.  
  21. [logger_root]
  22. level=DEBUG
  23. handlers=consoleHandler,cloudLogHandler
  24.  
  25. [logger_cloudinit]
  26. level=DEBUG
  27. qualname=cloudinit
  28. handlers=
  29. propagate=1
  30.  
  31. [handler_consoleHandler]
  32. class=StreamHandler
  33. level=WARNING
  34. formatter=arg0Formatter
  35. args=(sys.stderr,)
  36.  
  37. [formatter_arg0Formatter]
  38. format=%(asctime)s cloud-init[%(process)d]: %(filename)s[%(levelname)s]: %(message)s
  39. datefmt=%b %d %H:%M:%S
  40.  
  41. [formatter_simpleFormatter]
  42. format=[CLOUDINIT] %(filename)s[%(levelname)s]: %(message)s
  43. - &log_file |
  44. [handler_cloudLogHandler]
  45. class=FileHandler
  46. level=DEBUG
  47. formatter=arg0Formatter
  48. args=('/var/log/cloud-init.log',)
  49. - &log_syslog |
  50. [handler_cloudLogHandler]
  51. class=handlers.SysLogHandler
  52. level=DEBUG
  53. formatter=simpleFormatter
  54. args=("/dev/log", handlers.SysLogHandler.LOG_USER)
  55.  
  56. log_cfgs:
  57. # Array entries in this list will be joined into a string
  58. # that defines the configuration.
  59. #
  60. # If you want logs to go to syslog, uncomment the following line.
  61. # - [ *log_base, *log_syslog ]
  62. #
  63. # The default behavior is to just log to a file.
  64. # This mechanism that does not depend on a system service to operate.
  65. - [ *log_base, *log_file ]
  66. # A file path can also be used.
  67. # - /etc/log.conf
  68.  
  69. # This tells cloud-init to redirect its stdout and stderr to
  70. # 'tee -a /var/log/cloud-init-output.log' so the user can see output
  71. # there without needing to look on the console.
  72. output: {all: '| tee -a /var/log/cloud-init-output.log'}
Add Comment
Please, Sign In to add comment