Ben,

Is there a way the current HTML layout could be customized to be better
suited to your use-case?

Gary

On Mon, Nov 9, 2015 at 11:09 AM, Benjamin Jaton <[email protected]>
wrote:

> Thanks the feedback.
> I found that the easiest way to achieve this was to have the PatternLayout
> class support to set the contentType to "text/html".
> Then one can write HTML directly in the pattern.
>
> Thanks again,
> Ben
>
> On Mon, Nov 9, 2015 at 6:51 AM, Remko Popma <[email protected]> wrote:
>
> > Ben,
> >
> > The built-in HTML layout (
> >
> https://logging.apache.org/log4j/2.x/log4j-core/xref/org/apache/logging/log4j/core/layout/HtmlLayout.html
> )
> > does not support much customization.
> >
> > It sounds like you may want to create a custom layout and specify that
> > layout with the SMTP appender.
> >
> > This manual page may be a good place to get started:
> > http://logging.apache.org/log4j/2.x/manual/extending.html#Layouts
> >
> > Best regards,
> > Remko
> >
> > > On 2015/11/06, at 4:55, Benjamin Jaton <[email protected]>
> wrote:
> > >
> > > Hi,
> > >
> > > I am using the SMTPAppender with a custom pattern:
> > >  "PatternLayout" : { "pattern" : "<a href='...'>%m</a><br/>" }
> > >
> > > But the email is sent as text.
> > >
> > > I saw that there is a HTMLLayout but it doesn't seem to accept a
> pattern?
> > >
> > > How can I produce a custom HTML message?
> > >
> > > Thanks!
> > > Ben
> >
>



-- 
E-Mail: [email protected] | [email protected]
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
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

Reply via email to