Skip to content

Commit

Permalink
Merge pull request #127 from PHOENIXCONTACT/fix/loggerName
Browse files Browse the repository at this point in the history
Fixed name of logger in resource initialization
  • Loading branch information
Toxantron authored Nov 8, 2021
2 parents 5bb7af1 + 6f06f68 commit 3999aa3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Moryx.AbstractionLayer/Resources/Resource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0

using System;
Expand Down Expand Up @@ -61,7 +61,8 @@ public abstract class Resource : ILoggingComponent, IResource, IInitializablePlu
/// <inheritdoc />
void IInitializable.Initialize()
{
Logger = Logger?.GetChild(Name, GetType());
var loggerName = Name.Replace(".", "_"); // replace . with _ because of logger child structure
Logger = Logger?.GetChild(loggerName, GetType());
OnInitialize();
}

Expand Down

0 comments on commit 3999aa3

Please sign in to comment.