default_config_sample.go 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package hieda_yamlutil
  2. const DefaultConfigSampel = `
  3. # Enable logger
  4. enable: true
  5. # Backends
  6. backends:
  7. local_rotate_file:
  8. # Should be one of 'console', 'file', 'alisls'
  9. type: "file"
  10. # Minimum emit level, should be one of 'DEBUG', 'VERBOSE', 'INFO', 'WARN', 'ERROR', 'PANIC', 'FATAL'
  11. level: "VERBOSE"
  12. # This field should exist for type 'file'
  13. file_config:
  14. # The path to log file
  15. filename: "log_filename.log"
  16. # Use 'true' for using console backend formatter for file backend
  17. fvconsole: false
  18. # Use 'true' for enable rotate
  19. rotate: true
  20. # This field should exist for rotate log
  21. rotate_config:
  22. # The maximum size in megabytes of the log file before it gets rotated
  23. maxsize: 2
  24. # The maximum number of days to retain old log files based on the timestamp encoded in their filename.
  25. # Note that a day is defined as 24 hours and may not exactly correspond to calendar days due to daylight
  26. # savings, leap seconds, etc. '0' for not to remove old log files based on age
  27. maxage: 30
  28. # The maximum number of old log files to retain. '0' for retain all old log files
  29. # (though MaxAge may still cause them to get deleted.)
  30. maxbackups: 24
  31. # This determines if the time used for formatting the timestamps in backup files is the computer's local time.
  32. # 'false' to use UTC time, 'true' to use local time.
  33. localtime: true
  34. # This determines if the rotated log files should be compressed using gzip.
  35. # 'true' for using gzip, 'false' for not using gzip
  36. compress: true
  37. sample_backend_alisls:
  38. # Should be one of 'console', 'file', 'alisls'
  39. type: "alisls"
  40. # Minimum emit level, should be one of 'DEBUG', 'VERBOSE', 'INFO', 'WARN', 'ERROR', 'PANIC', 'FATAL'
  41. level: "DEBUG"
  42. # This field should exist for type 'file'
  43. alisls_config:
  44. # Use 'true' for enable AliSLS producer debug log.
  45. # AliSLS producer will print log to stdout, and we have no way to disable it,
  46. # but we can specify the output level. 'true' for level 'debug', 'false' for level 'error'
  47. alisls_producer_debug: false
  48. # Your Hieda Logger hostname
  49. hostname: "<Your Hostname>"
  50. # Your Hieda Logger app name
  51. appname: "<Your App Name>"
  52. # Your AliSLS appkey id
  53. ak_id: "<Your SLS Appkey ID>"
  54. # Your AliSLS appkey secret
  55. ak_secret: "<Your SLS Appkey Secret>"
  56. # Your AliSLS endpoint
  57. endpoint: "cn-hongkong.log.aliyuncs.com"
  58. # Your AliSLS project
  59. project: "<Your SLS Project Name>"
  60. # Your AliSLS logstore
  61. logstore: "<Your SLS Logstore Name>"
  62. # Your AliSLS topic
  63. topic: "<Your SLS Topic>"
  64. # The IP address for AliSLS emit parameter 'source'
  65. emit_ip: "0.0.0.0"
  66. # Use 'true' to override 'emit_ip' below with your real Internet IP address if possible
  67. override_with_real_ip: true
  68. # Do not specify this in most situation. Refer to Aliyun SLS documentation.
  69. # extend_alisls_config:
  70. # total_size_ln_bytes: 104857600
  71. # max_io_worker_count: 50
  72. # max_block_sec: 60
  73. # max_batch_size: 524288
  74. # max_batch_count: 4096
  75. # linger_ms: 2000
  76. # retries: 10
  77. # max_reserved_attempts: 11
  78. # base_retry_backoff_ms: 100
  79. # max_retry_backoff_ms: 50000
  80. # adjust_sharg_hash: true
  81. # buckets: 64
  82. # allow_log_level: ""
  83. # log_file_name: ""
  84. # is_json_type: false
  85. # log_max_size: 0
  86. # log_max_backups: 0
  87. # log_compress: false
  88. # no_retry_status_code_list:
  89. # - 400
  90. # - 404
  91. `