java - JSONs format logs are not translated into Cyrillic -
this appender jsonl logging logback.xml file
<?xml version="1.0" encoding="utf-8"?> <appender name="jsonl_log" class="ch.qos.logback.core.rolling.rollingfileappender"> <file>logs/card_gate_json.jsonl</file> <encoder class="net.logstash.logback.encoder.logstashencoder"/> <rollingpolicy class="ch.qos.logback.core.rolling.timebasedrollingpolicy"> <filenamepattern>logs/card_gate.%d{yyyy-mm-dd}.%i.log.zip</filenamepattern> <timebasedfilenamingandtriggeringpolicy class="ch.qos.logback.core.rolling.sizeandtimebasedfnatp"> <maxfilesize>50mb</maxfilesize> </timebasedfilenamingandtriggeringpolicy> <minindex>1</minindex> <maxindex>50</maxindex> </rollingpolicy> </appender>
this example log, note, cyrillic text in ascii code.
{"@timestamp":"2016-09-22t14:04:40.886+03:00","@version":1,"message":"card gate \u0432\u0435\u0440\u0441\u0438\u044f 003.00","logger_name":"ru.billing.cardgate.cardgate","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.902+03:00","@version":1,"message":"\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0441 \u0431\u0430\u043d\u043a\u0430\u043c\u0438","logger_name":"ru.billing.cardgate.cardgate","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.927+03:00","@version":1,"message":"\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0431\u0430\u043d\u043a\u0430\u043c\u0438. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 acquire_emulator_mode = true","logger_name":"ru.billing.cardgate.bankclient.bankfactory","thread_name":"main","level":"warn","level_value":30000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.928+03:00","@version":1,"message":"\u0421\u0442\u0430\u0440\u0442 https \u0441\u0435\u0440\u0432\u0435\u0440\u0430","logger_name":"ru.billing.cardgate.cardgate","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.933+03:00","@version":1,"message":"last transaction number before initialisation 123 date thu sep 22 00:00:00 msk 2016","logger_name":"ru.billing.cardgate.context.transactioncounter","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.934+03:00","@version":1,"message":"calendar day of year value 266","logger_name":"ru.billing.cardgate.context.transactioncounter","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.938+03:00","@version":1,"message":"saxbuilder pool initialized 2 saxbuilder","logger_name":"ru.billing.cardgate.context.saxpool.saxpool","thread_name":"main","level":"debug","level_value":10000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.938+03:00","@version":1,"message":"current directory: c:\\users\\sultan.isaev\\desktop\\sfolder\\code\\unipay_iso8583_gate\\user_part\\unipay_iso8583_gate","logger_name":"ru.billing.cardgate.server.cardserver","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.938+03:00","@version":1,"message":"\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043a\u043b\u044e\u0447\u0435\u0439: src/certificates/server.jks","logger_name":"ru.billing.cardgate.server.cardserver","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:40.974+03:00","@version":1,"message":"\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043f\u043e\u0440\u0442\u0443: 8090","logger_name":"ru.billing.cardgate.server.cardserver","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:41.222+03:00","@version":1,"message":"\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u043f\u043e\u0440\u0442: 8090","logger_name":"ru.billing.cardgate.server.cardserver","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"} {"@timestamp":"2016-09-22t14:04:41.223+03:00","@version":1,"message":"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439: 2","logger_name":"ru.billing.cardgate.server.cardserver","thread_name":"main","level":"info","level_value":20000,"hostname":"wks-18384"}
i need write logs in russian. whoever knows please.
you should encode utf-16, it's required cyrillic characters.
this answer you're looking for.
see more details question duplicate :
Comments
Post a Comment