Skip to content

Commit a207def

Browse files
name refactoring
1 parent 3f74a92 commit a207def

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

TestLog/appsettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"LoggerOptions": {
3-
"applicationName": "eazy-logging-service",
4-
"excludePaths": [ "/ping", "/metrics" ],
3+
"name": "eazy-api",
4+
"ignoredPaths": [ "logs", "/ping", "/metrics" ],
55
"level": "information",
66
"file": {
77
"enabled": true,

src/eazy.logger/Logging/Extensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static IHostBuilder UseEazyLogging(this IHostBuilder hostBuilder,
2929
.Enrich
3030
.WithProperty("Environment",
3131
context.HostingEnvironment.EnvironmentName) //development ? production
32-
.Enrich.WithProperty("Application", options.ApplicationName) //App Name
32+
.Enrich.WithProperty("Application", options.Name) //App Name
3333
.Enrich.WithProperty("Instance", "Instance")
3434
.Enrich.WithProperty("Version", "v1");
3535

@@ -47,12 +47,12 @@ in options.MinimumLevelOverrides
4747
loggerConfig.MinimumLevel.Override(key, FetchLogEventLevel(value));
4848

4949

50-
options.ExcludePaths?.ToList().ForEach(p
50+
options.IgnoredPaths?.ToList().ForEach(p
5151
=> loggerConfig.Filter
5252
.ByExcluding(
5353
Matching.WithProperty<string>("RequestPath", n => n.EndsWith(p))));
5454

55-
options.ExcludeProperties?.ToList().ForEach(p
55+
options.IgnoredProperties?.ToList().ForEach(p
5656
=> loggerConfig.Filter
5757
.ByExcluding(Matching.WithProperty(p)));
5858

@@ -97,7 +97,7 @@ private static void MapOptions(LoggerOptions loggerOptions, string appOptions,
9797
loggerConfig.Enrich.FromLogContext()
9898
.MinimumLevel.Is(level)
9999
.Enrich.WithProperty("Environment", environmentName)
100-
.Enrich.WithProperty("Application", loggerOptions.ApplicationName)
100+
.Enrich.WithProperty("Application", loggerOptions.Name)
101101
.Enrich.WithProperty("Instance", "Instance")
102102
.Enrich.WithProperty("Version", "v1");
103103

@@ -110,12 +110,12 @@ private static void MapOptions(LoggerOptions loggerOptions, string appOptions,
110110
loggerConfig.MinimumLevel.Override(key, logLevel);
111111
}
112112

113-
loggerOptions.ExcludePaths?.ToList().ForEach(p => loggerConfig.Filter
113+
loggerOptions.IgnoredPaths?.ToList().ForEach(p => loggerConfig.Filter
114114
.ByExcluding(
115115
Matching.WithProperty<string>(
116116
"RequestPath", n => n.EndsWith(p))));
117117

118-
loggerOptions.ExcludeProperties?.ToList().ForEach(p => loggerConfig.Filter
118+
loggerOptions.IgnoredProperties?.ToList().ForEach(p => loggerConfig.Filter
119119
.ByExcluding(Matching.WithProperty(p)));
120120
}
121121

src/eazy.logger/Logging/LoggerOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ namespace eazy.logger.Logging
55
{
66
public class LoggerOptions
77
{
8-
public string ApplicationName { get; set; }
8+
public string Name { get; set; }
99
public string Level { get; set; }
1010
public FileOptions File { get; set; }
1111
public SeqOptions Seq { get; set; }
1212
public DatabaseOptions Database { get; set; }
1313
public IDictionary<string, string> MinimumLevelOverrides { get; set; }
14-
public IEnumerable<string> ExcludePaths { get; set; }
15-
public IEnumerable<string> ExcludeProperties { get; set; }
14+
public IEnumerable<string> IgnoredPaths { get; set; }
15+
public IEnumerable<string> IgnoredProperties { get; set; }
1616
public IDictionary<string, object> Tags { get; set; }
1717
}
1818
}

src/eazy.logger/easy.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"LoggerOptions": {
3-
"applicationName": "simple-logging-service",
4-
"excludePaths": [ "/ping", "/metrics" ],
3+
"name": "simple-logging-service",
4+
"ignoredPaths": [ "/ping", "/metrics" ],
55
"level": "information",
66
"file": {
77
"enabled": true,

0 commit comments

Comments
 (0)