log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]

mkamoski

Dear log4net Power Users,

Please help with this error...

log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo]
to set object on [log4net.Layout.PatternLayout]

...my config looks like this...

<?xml version="1.0" encoding="utf-8" ?>
<log4net>
    <appender name="RollingFile"
type="log4net.Appender.RollingFileAppender">
        <file value="Portals/_default/Logs/" />
        <datePattern value="yyyy.MM.dd'.log.resources'" />
        <rollingStyle value="Date" />
        <staticLogFileName value="false" />
        <appendToFile value="true" />
        <maximumFileSize value="10MB" />
        <maxSizeRollBackups value="5" />
        <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date
[%property{log4net:HostName}][Thread:%thread][%level] %logger -
%message%newline" />
            <locationInfo value="false" />
        </layout>
    </appender>
    <root>
        <level value="Error" />
        <appender-ref ref="RollingFile" />
    </root>
</log4net>

...so what do I need to do to get rid of that error?

Please advise.

Thanks.

-- Mark Kamoski




--
Sent from: http://apache-logging.6191.n7.nabble.com/Log4net-Users-f19152.html
Reply | Threaded
Open this post in threaded view
|

RE: log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]

Lansdaal, Michael T
Never used "locationInfo" before (in my log4net config files), but you have it as a child of "layout".

This reference (https://logging.apache.org/log4net/release/sdk/html/P_log4net_Layout_XmlLayoutBase_LocationInfo.htm )
Has this remark:
If you are embedding this layout within an SMTPAppender then make sure to set the LocationInfo option of that appender as well

So, do you have "locationInfo" in the right place?

Thanks, Mike


-----Original Message-----
From: mkamoski [mailto:[hidden email]]
Sent: Monday, October 23, 2017 4:57 AM
To: [hidden email]
Subject: log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]


Dear log4net Power Users,

Please help with this error...

log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]

...my config looks like this...

<?xml version="1.0" encoding="utf-8" ?>
<log4net>
    <appender name="RollingFile"
type="log4net.Appender.RollingFileAppender">
        <file value="Portals/_default/Logs/" />
        <datePattern value="yyyy.MM.dd'.log.resources'" />
        <rollingStyle value="Date" />
        <staticLogFileName value="false" />
        <appendToFile value="true" />
        <maximumFileSize value="10MB" />
        <maxSizeRollBackups value="5" />
        <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date [%property{log4net:HostName}][Thread:%thread][%level] %logger - %message%newline" />
            <locationInfo value="false" />
        </layout>
    </appender>
    <root>
        <level value="Error" />
        <appender-ref ref="RollingFile" />
    </root>
</log4net>

...so what do I need to do to get rid of that error?

Please advise.

Thanks.

-- Mark Kamoski




--
Sent from: http://apache-logging.6191.n7.nabble.com/Log4net-Users-f19152.html


Reply | Threaded
Open this post in threaded view
|

RE: log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]

Radovan Raszka
In reply to this post by mkamoski
Simply remove <locationInfo value="false" /> node from configuration.
Location is property of XmlLayoutBase class, but PatternLayout doesn't inherit from this class.

Radovan

-----Original Message-----
From: mkamoski [mailto:[hidden email]]
Sent: Monday, October 23, 2017 1:57 PM
To: [hidden email]
Subject: log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]


Dear log4net Power Users,

Please help with this error...

log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]

...my config looks like this...

<?xml version="1.0" encoding="utf-8" ?>
<log4net>
    <appender name="RollingFile"
type="log4net.Appender.RollingFileAppender">
        <file value="Portals/_default/Logs/" />
        <datePattern value="yyyy.MM.dd'.log.resources'" />
        <rollingStyle value="Date" />
        <staticLogFileName value="false" />
        <appendToFile value="true" />
        <maximumFileSize value="10MB" />
        <maxSizeRollBackups value="5" />
        <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date [%property{log4net:HostName}][Thread:%thread][%level] %logger - %message%newline" />
            <locationInfo value="false" />
        </layout>
    </appender>
    <root>
        <level value="Error" />
        <appender-ref ref="RollingFile" />
    </root>
</log4net>

...so what do I need to do to get rid of that error?

Please advise.

Thanks.

-- Mark Kamoski




--
Sent from: http://apache-logging.6191.n7.nabble.com/Log4net-Users-f19152.html
Reply | Threaded
Open this post in threaded view
|

RE: log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]

mkamoski
Thanks, that seems to have worked, and etc.



--
Sent from: http://apache-logging.6191.n7.nabble.com/Log4net-Users-f19152.html