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.

126 lines
3.6KB

  1. {
  2. "Logging": {
  3. "LogLevel": {
  4. "Default": "Information",
  5. "Microsoft": "Warning",
  6. "Microsoft.Hosting.Lifetime": "Information",
  7. "HttpClient": "Information"
  8. }
  9. },
  10. "Serilog": {
  11. "Using": [ "Serilog.Sinks.File", "Serilog.Sinks.Console", "Serilog.Expressions" ],
  12. "MinimumLevel": {
  13. "Default": "Information",
  14. "Override": {
  15. "Microsoft": "Warning",
  16. "System": "Warning"
  17. }
  18. },
  19. "Enrich": [
  20. "FromLogContext",
  21. "WithThreadId"
  22. ],
  23. "WriteTo": [
  24. {
  25. "Name": "Console",
  26. "Args": {
  27. "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level}] [Thread-{ThreadId}] [{SourceContext:l}] [{RequestId}]{NewLine}{Message}{NewLine}"
  28. }
  29. },
  30. {
  31. "Name": "Logger",
  32. "Args": {
  33. "ConfigureLogger": {
  34. "WriteTo": [
  35. {
  36. "Name": "File",
  37. "Args": {
  38. "restrictedToMinimumLevel": "Information",
  39. "path": "/var/health_monitor/logs/infos/info.log",
  40. "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level}] [Thread-{ThreadId}] [{SourceContext:l}] [{RequestId}] {Message}{NewLine}{Exception}",
  41. //"fileSizeLimitBytes": 524288000,
  42. "rollingInterval": "Day",
  43. "rollOnFileSizeLimit": "true",
  44. "retainedFileCountLimit": 7
  45. }
  46. }
  47. ],
  48. "Filter": [
  49. {
  50. "Name": "ByIncludingOnly",
  51. "Args": {
  52. "Expression": "@l = 'Information'"
  53. }
  54. }
  55. ]
  56. }
  57. }
  58. },
  59. {
  60. "Name": "Logger",
  61. "Args": {
  62. "ConfigureLogger": {
  63. "WriteTo": [
  64. {
  65. "Name": "File",
  66. "Args": {
  67. "RestrictedToMinimumLevel": "Warning",
  68. "RollingInterval": "Day",
  69. "RollOnFileSizeLimit": "true",
  70. "OutputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff }[{Level:u3}] [Thread-{ThreadId}] [{SourceContext:l}] [{RequestId}] {Message:lj}{NewLine}",
  71. "Path": "/var/health_monitor/logs/warnings/warn.log",
  72. "RetainedFileCountLimit": 10
  73. }
  74. }
  75. ],
  76. "Filter": [
  77. {
  78. "Name": "ByIncludingOnly",
  79. "Args": {
  80. "Expression": "@l = 'Warning'"
  81. }
  82. }
  83. ]
  84. }
  85. }
  86. },
  87. {
  88. "Name": "Logger",
  89. "Args": {
  90. "ConfigureLogger": {
  91. "WriteTo": [
  92. {
  93. "Name": "File",
  94. "Args": {
  95. "restrictedToMinimumLevel": "Error",
  96. "path": "/var/health_monitor/logs/errors/error.log",
  97. "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level}] [Thread-{ThreadId}] [{SourceContext:l}] [{RequestId}] {Message}{NewLine}{Exception}",
  98. //"fileSizeLimitBytes": 524288000,
  99. "rollingInterval": "Day",
  100. "rollOnFileSizeLimit": "true",
  101. "retainedFileCountLimit": 7
  102. }
  103. }
  104. ],
  105. "Filter": [
  106. {
  107. "Name": "ByIncludingOnly",
  108. "Args": {
  109. "Expression": "@l = 'Error'"
  110. }
  111. }
  112. ]
  113. }
  114. }
  115. }
  116. ]
  117. },
  118. //"Logging": {
  119. // "LogLevel": {
  120. // "Default": "Information",
  121. // "Microsoft.AspNetCore": "Warning"
  122. // }
  123. //},
  124. "AllowedHosts": "*"
  125. }