Re: ERROR HTMLLayout contains invalid attributes "datePattern", "timezone"

Gary Gregory <[email protected]>
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <CACZkXPwxpy_jyEO8sPRX6EFWo7qTiQv+d8Yw-1PsN+C5A_xw1w@mail.gmail.com>
The docs match the current version of the code for 2.14.x, not 2.6.x.

Gary


On Sun, Feb 14, 2021, 12:51 Jeff Schmidt <[email protected]>
wrote:

> I'm trying to setup HTML Logging, and want to change the date Pattern. I
> found the following page:
>
> https://logging.apache.org/log4j/2.x/manual/layouts.html#HTMLLayout
>
> Which indicates that HtmlLayout has those to parameters:
>
>
> However, when I run my program, I get an error:
>
> ERROR HTMLLayout contains invalid attributes "datePattern", "timezone"
>
> Here's a snippet from my log4j.xml where I set this up:
>
> <Appenders>
>         <RollingFile name="logfile" fileName="sicli-log.html"
>             append="true" filePattern="sicli-log-%i.html.gz">
>             <SizeBasedTriggeringPolicy size="10MB" />
>             <DefaultRolloverStrategy fileIndex='min'
>                 max="5" />
>             <HtmlLayout title="sicli log" datePattern="DEFAULT"
> timezone="America/New_York" />
>         </RollingFile>
>     </Appenders>
>
> And here's the pom.xml version for log4j2:
>
>         <dependency>
>             <groupId>org.apache.logging.log4j</groupId>
>             <artifactId>log4j-api</artifactId>
>             <version>2.6.1</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.logging.log4j</groupId>
>             <artifactId>log4j-core</artifactId>
>             <version>2.6.1</version>
>         </dependency>
>
> The documentation clearly shows that those should be valid parameters, so
> why am I getting that error?
>
> Thank you for your help in this matter.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.