logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chathura Priyankara <priyankara...@gmail.com>
Subject Re: [Dev][Log4j2]Log4j2 converter for '@' is not working
Date Thu, 21 May 2015 04:52:15 GMT
What can be the issue for this ?

On Tue, May 19, 2015 at 6:01 PM, Chathura Priyankara <
priyankarahac@gmail.com> wrote:

> Hi all,
>
> I created following simple converter to append @ sign in to a log record,
>
> @Plugin(name="AtSignPatternConverter", category = "Converter")
> @ConverterKeys({"@"})
> public class AtSignPatternConverter extends LogEventPatternConverter{
>
>     protected AtSignPatternConverter(String name, String style) {
>         super(name, style);
>     }
>
>     public static AtSignPatternConverter newInstance(String[] options){
>         return new AtSignPatternConverter("@","@");
>     }
>
>     @Override
>     public void format(LogEvent event, StringBuilder toAppendTo) {
>         toAppendTo.append("@");
>     }
> }
>
> However when I'm using %@ for conversion pattern. I'm getting following
> exception.
>
> 2015-05-19 17:53:55,301 ERROR Unrecognized format specifier []
> 2015-05-19 17:53:55,302 ERROR Empty conversion specifier starting at
> position 7 in conversion pattern.
>
> (There are other some converters which are working fine in the same
> package with this)
>
> In log4j2 is it not allowed create converter for this symbol ?
> can anyone please explain me why this is happening ?
>
> Thanks,
> Any help is highly appreciated.
>
> --
> Chathura Priyankara,
> Faculty of Information Technology,
> University of Moratuwa.
>



-- 
Chathura Priyankara,
Faculty of Information Technology,
University of Moratuwa.
Blog  : www.codeoncloud.blogspot.com

Mime
View raw message