Skip to content

Unable to configure simpleLoggingAdvice in latest version #341

@Julie-House

Description

@Julie-House

I'm having an issue with upgrading our Spring version. We currently have version 1.3.2, which can throw errors when our application (WinForms) starts up. In the hopes of speeding this process up, I want to upgrade to 3.0.3 as I found this issue was fixed.

A second thing I was looking at was the ability to filter our logs more and move all Spring messages into a separate log file. I also wanted to log the entering/exiting messages at an Info level so they would show up without having to change settings (performance is a big issue at the moment...). I made this change when we had the old version of Spring and it worked great. However, with the new version, the logging dependency has changed from Common Logging to Microsoft Logging Abstractions.

<object id="simpleLoggingAdvice" type="Spring.Aspects.Logging.SimpleLoggingAdvice, Spring.Aop">
        <property name="LogUniqueIdentifier" value="false"/>
        <property name="LogExecutionTime"    value="true"/>
        <property name="LogMethodArguments"  value="true"/>
        <property name="Separator"           value=";"/>
        <property name="LogLevel"            value="Info"/>
        <property name="HideProxyTypeNames"  value="true"/>
        <property name="UseDynamicLogger"    value="true"/>
    </object>

Previously, the LogLevel value had been Debug. The change to Info worked fine for 1.3.2. Upgrading to 3.0.3 causes this error:
Spring.Objects.Factory.ObjectCreationException: Error creating object with name 'simpleLoggingAdvice' defined in 'assembly , resource [Services.Core.xml] line 7' : Error setting property values: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are: [Spring.Core.TypeMismatchException: Cannot convert property value of type [System.String] to required type [Microsoft.Extensions.Logging.LogLevel] for property 'LogLevel'., Inner Exception: System.FormatException: Info is not a valid value for LogLevel. ---> System.ArgumentException: Requested value 'Info' was not found.

Changing this value to Information stops the error, but I don't get any Spring logs coming through at all anymore.

I'm also using Log4Net (currently stuck on 1.2.10, hoping we can upgrade that too).

I'm now trying to upgrade to 3.0.2 as that's the last version using Common Logging, however, this also requires lots of upgrades! (My new company have not kept up-to-date well...).

Is there a way to get this working as I can't find any documentation for Spring (the main Spring website seems to be broken - links aren't working).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions