logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: Log4j2 - Custom HTML Layout footer not getting called to end the log file
Date Fri, 09 Jan 2015 22:05:28 GMT
I fixed the hr noshade issue with

Please verify and close https://issues.apache.org/jira/browse/LOG4J2-933

If you can try again with the stock HTML layout that will be one less thing
to worry about in your configuration for what you want to ultimately

You can build a 2.2-SNAPSHOT locally by clone our git repo.

Thank you,

On Thu, Jan 8, 2015 at 12:02 AM, ppiman <ppiman@gmail.com> wrote:

> Hello,
> I've run into a problem that I just can't figure out and I'm hoping you
> will be able to help me.
> My goal is to have log4j keep adding to the log file and at some point be
> able called the log url address and my app display the log file on the fly
> with out stopping the app or undeploying it.
> So here goes:
> I'm trying to do a log file for a web app. My app is JSF 2 (xhtml). I've
> got my custom HTML Layout  that I extend from AbstractStringLayout. (Reason
> I made custom HTML Layout was with XHTML this line in the log4j HTMLLayout
> was throwing an error:  sbuf.append("<hr size=\"1\" noshade">") and XHTML
> wants an <hr size=\"1\" noshade=\"noshade\">)
> Now when I run my app, the log is generated and everthing is working except
> the getFooter() method never gets called to finish the table and file.
> Which when I call the URL to the log file I get a error saying the document
> structure is not complete.
> log4j2.xml file:
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="INFO" packages="com.qualcomm.asictracker.util">
>     <Properties>
>         <Property name="log-path">${web:rootDir}/WEB-INF/logs</Property>
>     </Properties>
>     <Appenders>
>         <File name="HTMLAppender" fileName="${log-path}/asictracker.html"
> append="true" immediateFlush="true">
>             <MyHtmlLayout locationInfo="true" charset="UTF-8" title="ASIC
> Tracker Logs"></MyHtmlLayout>
>         </File>
>     </Appenders>
>     <Loggers>
>         <Root level="debug" >
>             <AppenderRef ref="HTMLAppender"/>
>         </Root>
>     </Loggers>
> </Configuration>
> I'm using a blank XHTML file that has a ui:include to include my html log4j
> output.
> Jar's Using:
> log4j-api-2.1.jar
> log4j-core-2.1.jar
> log4j-web-2.1.jar
> Sorry for the long email. Trying to give you as much details as possible.
> Thanks for the help.
> -Dale

E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message