2

I have a regular Ubuntu 16.04 server VM. My locale is set up to utf-8 everywhere:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

My application is set up to log both to its own files, and to standard output, which is consumed into systemd-journald (all the default). But when my application output is not ASCII, journalctl seems to truncate to ASCII:

$ journalctl -u some.app --since "5 minutes ago"
Dec 01 14:37:57 some.hostname java[7037]: 2017-12-01 14:37:57.457 +0000 INFO : 
controllers.Users - Updating user: {"????":"???????","???????_???????_?????":"1","???????_???????_????_??????":"2","???????_???????_?????":"3"}

while both application logs, and output that I piped into a file when starting application manually, contain correct UTF-8 encoded output.

What am I doing wrong? Why journalctl seems to output in ASCII?

  • Have you tried the --all argument? – Artem S. Tashkinov Dec 1 '17 at 19:14
  • @ArtemS.Tashkinov - Yes, no change. – Rogach Dec 1 '17 at 19:59
  • 1
    man systemd-journald.service says: Log data collected by the journal is primarily text based but can also include binary data. man journald.conf gives options to forward logs to /dev/console. If that preserves UTF-8, then the corruption happens somewhere inside journalctl. – Camille Goudeseune May 11 '18 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.