default_config_sample.go 4.0 KB

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