[logback-user] How to add less than (<) and greater than (>) in logback.xml

Debraj Manna subharaj.manna at gmail.com
Fri Jan 19 19:02:27 CET 2018


Yes I have made the encoder as below

<pattern>%p [%d{yyyy-MM-dd HH:mm:ss,SSS}] %c{3}:[%C{1}:%M:%L] -
[%t][%file:%line] -
%replace(%.-20480m){'[^A-Za-z0-9=<>:@\\-\\[\\]\n\\s!]','_'}%n
 </pattern>

But line number & file name is not showing up for example

INFO [2018-01-19 16:39:31] c.v.c.u.GCNotificationListener:[?:?:?] -
[Service Thread] - GC_DETAILS _ ID=9_ GC_TYPE=end of minor GC_ GC_NAME=PS
Scavenge_ DURATION_millis_=43_ GC_CAUSE=Allocation Failure_
GC_START_TIME_millsAfterJVMStart_=7198_ GC_END_TIME_millsAfterJVMStart_=7241


On Fri, Jan 19, 2018 at 6:10 PM, Debraj Manna <subharaj.manna at gmail.com>
wrote:

> Crossposting from stackoverflow
> <https://stackoverflow.com/questions/48341348/how-to-add-less-than-and-greater-than-in-logback-xml>
>
> Can someone let me know how can I add less than (<) and greater than (>)
> sign in logback.xml?
>
> I want to have a encoder.pattern like below
>
> <encoder>
>  <pattern>%p [%d{yyyy-MM-dd HH:mm:ss,SSS}] %c{3}:[%C{1}:%M:%L] - [%t] - %replace(%.-20480m){'[^A-Za-z0-9=<>:@\\-\\[\\]\n\\s!]','_'}%n
>  </pattern><encoder>
>
> But this is failing because of the presence of <> ?
>
> Thanks,
> Debraj
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20180119/2b754ce3/attachment-0001.html>


More information about the logback-user mailing list