Skip to content

We should centralise logging #4864

Open
@MDoerner

Description

@MDoerner

Currently, we sprinkle LogManager.GetCurrentClassLogger() all over the code base and, thus, spread a direct dependency to NLog all over the solution. As was discussed in chat several times, we should probably take a nore structurised approach to this.

One concern in the past was that when deriving from a type GetCurrentClassLogger in the base gets the logger with the message setup for the base class. However, this can be circumvented using LogManager.GetLogger(GetType()FullName).

Using this, I would like to suggest to introduce two abstract base classes for logging providing a protected logger, one generic and one not. The non-generic one will be used for classes at the top of an inheritance hierarchy and the generic one for derived class. The latter will derive from its generic parameter in order to circumvent the need for (illegal) multiple-inheritance. (I hope this is actually legal in C#.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    development-issueIssues encountered while developing RD, not in RD itselftechnical-debtThis makes development harder or is leftover from a PullRequest. Needs to be adressed at some point.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions