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

Gary Gregory <[email protected]>
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <CACZkXPz_G+o7VH=uCKY9GYiDE8Z=8XCmVE+5UrCNN6XWiui-3w@mail.gmail.com>
Good luck! :-)

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

> Oooh, I didn't catch that I didn't have the latest version in the pom. I
> must have gotten that maven xml from some other source, like an article
> about log4j.
>
> Thank you. Glad I included that in my first email, just in case.
>
>
> On 2/14/21 12:53 PM, Gary Gregory wrote:
> > 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] <mailto:[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.