You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.1KB

  1. {
  2. "Logging": {
  3. "LogLevel": {
  4. "Default": "Information",
  5. "Microsoft.AspNetCore": "Warning"
  6. }
  7. },
  8. "Serilog": {
  9. "Using": [ "Serilog.Sinks.File", "Serilog.Sinks.Async", "Serilog.Sinks.Console", "Serilog.Expressions" ],
  10. "MinimumLevel": {
  11. "Default": "Verbose",
  12. "Override": {
  13. "Microsoft": "Warning",
  14. "Microsoft.Hosting.Lifetime": "Information",
  15. "HttpClient": "Information"
  16. }
  17. },
  18. "WriteTo": [
  19. {
  20. "Name": "Console",
  21. "Args": {
  22. "restrictedToMinimumLevel": "Verbose",
  23. "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff }[{Level:u3}] [Thread-{ThreadId}] [{SourceContext:l}] [{RequestId}] {Message:lj}{NewLine}{Exception}",
  24. "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console"
  25. }
  26. },
  27. {
  28. "Name": "Logger",
  29. "Args": {
  30. "ConfigureLogger": {
  31. "WriteTo": [
  32. {
  33. "Name": "File",
  34. "Args": {
  35. "RestrictedToMinimumLevel": "Information",
  36. "RollingInterval": "Day",
  37. "RollOnFileSizeLimit": "true",
  38. "OutputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff }[{Level:u3}] [Thread-{ThreadId}] [{SourceContext:l}] [{RequestId}] {Message:lj}{NewLine}{Exception}",
  39. "Path": "/var/telpo_kafka_console/logs/infos/info.log",
  40. "RetainedFileCountLimit": 10 // "--设置日志文件个数最大值,默认31,意思就是只保留最近的31个日志文件", "等于null时永远保留文件": null
  41. //"FileSizeLimitBytes": 20971520, //设置单个文件大小为3M 默认1G
  42. //"RollOnFileSizeLimit": true //超过文件大小后创建新的
  43. }
  44. }
  45. ],
  46. "Filter": [
  47. {
  48. "Name": "ByIncludingOnly",
  49. "Args": {
  50. "Expression": "@l = 'Information'"
  51. }
  52. }
  53. ]
  54. }
  55. }
  56. },
  57. {
  58. "Name": "Logger",
  59. "Args": {
  60. "ConfigureLogger": {
  61. "WriteTo": [
  62. {
  63. "Name": "File",
  64. "Args": {
  65. "RestrictedToMinimumLevel": "Warning",
  66. "RollingInterval": "Day",
  67. "RollOnFileSizeLimit": "true",
  68. "OutputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff }[{Level:u3}] [Thread-{ThreadId}] [{SourceContext:l}] [{RequestId}] {Message:lj}{NewLine}",
  69. "Path": "/var/telpo_kafka_console/logs/warnings/warn.log",
  70. "RetainedFileCountLimit": 10
  71. }
  72. }
  73. ],
  74. "Filter": [
  75. {
  76. "Name": "ByIncludingOnly",
  77. "Args": {
  78. "Expression": "@l = 'Warning'"
  79. }
  80. }
  81. ]
  82. }
  83. }
  84. },
  85. {
  86. "Name": "Logger",
  87. "Args": {
  88. "ConfigureLogger": {
  89. "WriteTo": [
  90. {
  91. "Name": "File",
  92. "Args": {
  93. "RestrictedToMinimumLevel": "Error",
  94. "RollingInterval": "Day",
  95. "RollOnFileSizeLimit": "true",
  96. "OutputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff }[{Level:u3}] [Thread-{ThreadId}][{SourceContext:l}] [{RequestId}] {Message:lj}{NewLine}{Exception}",
  97. "Path": "/var/telpo_kafka_console/logs/errors/error.log",
  98. "RetainedFileCountLimit": 15 // "--设置日志文件个数最大值,默认31,意思就是只保留最近的31个日志文件", "等于null时永远保留文件": null
  99. //"FileSizeLimitBytes": 20971520, //设置单个文件大小为3M 默认1G
  100. //"RollOnFileSizeLimit": true //超过文件大小后创建新的
  101. }
  102. }
  103. ],
  104. "Filter": [
  105. {
  106. "Name": "ByIncludingOnly",
  107. "Args": {
  108. "Expression": "@l = 'Error'"
  109. }
  110. }
  111. ]
  112. }
  113. }
  114. }
  115. ]
  116. }
  117. }