How to add less than (<) and greater than (>) in logback.xml

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

Hello Debraj, Have you tried replacing '<' with '<' and '>' with '>' ? -- Ceki On 19.01.2018 13:40, Debraj Manna 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
_______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

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@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
participants (2)
-
Ceki
-
Debraj Manna