@@ -163,23 +163,18 @@ public static async Task Entry(string[] args, Action initAction, Action<LogOptio
163163 LogOptions . Default . LogEventLevel = launcherOptions . LogEventLevel ;
164164 LogOptions . Default . RollingInterval = launcherOptions . LogRollingInterval ;
165165 // 构建LogType,当值为空或默认值时不拼接
166- // var logTypeParts = new List<string>();
167- //
168- // if (!string.IsNullOrWhiteSpace(launcherOptions.ServerType))
169- // {
170- // logTypeParts.Add(launcherOptions.ServerType);
171- // }
172- //
173- // if (launcherOptions.ServerId > 0)
174- // {
175- // logTypeParts.Add(launcherOptions.ServerId.ToString());
176- // }
177- //
178- // if (launcherOptions.ServerInstanceId > 0)
179- // {
180- // logTypeParts.Add(launcherOptions.ServerInstanceId.ToString());
181- // }
166+ var logTypeParts = new List < string > ( ) ;
182167
168+ if ( launcherOptions . ServerId > 0 )
169+ {
170+ logTypeParts . Add ( launcherOptions . ServerId . ToString ( ) ) ;
171+ }
172+
173+ if ( launcherOptions . ServerInstanceId > 0 )
174+ {
175+ logTypeParts . Add ( launcherOptions . ServerInstanceId . ToString ( ) ) ;
176+ }
177+
183178 if ( launcherOptions . TagName . IsNotNullOrWhiteSpace ( ) )
184179 {
185180 LogOptions . Default . LogTagName = launcherOptions . TagName ;
@@ -196,6 +191,8 @@ public static async Task Entry(string[] args, Action initAction, Action<LogOptio
196191 {
197192 LogOptions . Default . LogTagName = launcherOptions . Description ;
198193 }
194+
195+ LogOptions . Default . LogTagName = logTypeParts . Count > 0 ? string . Join ( "_" , logTypeParts ) : null ;
199196 }
200197
201198 logConfiguration ? . Invoke ( LogOptions . Default ) ;
0 commit comments