저장된 저널ctl 로그를 읽을 수 없습니다.

저장된 저널ctl 로그를 읽을 수 없습니다.

내용을 읽어보니 man journalctl다음과 같은 내용을 발견했습니다.

   Storage=
       Controls where to store journal data. One of "volatile", "persistent", "auto" and "none". If "volatile", journal log data will be stored only in memory, i.e. below the
       /run/log/journal hierarchy (which is created if needed). If "persistent", data will be stored preferably on disk, i.e. below the /var/log/journal hierarchy (which is created
       if needed), with a fallback to /run/log/journal (which is created if needed), during early boot and if the disk is not writable.  "auto" is similar to "persistent" but the
       directory /var/log/journal is not created if needed, so that its existence controls where log data goes.  "none" turns off all storage, all log data received will be dropped.
       Forwarding to other targets, such as the console, the kernel log buffer, or a syslog socket will still work however. Defaults to "auto".

그러나 less거기에 파일을 만들려고 하면 다음과 같은 결과가 나타납니다.

[root@long-misc-p001 logs]# less /run/log/journal/xxxxxx/system.journal
"/run/log/journal/xxxxxx/system.journal" may be a binary file.  See it anyway?

아직 해당 옵션을 설정하지 않았지만 persistent계속해서 실행하면 less바이너리 파일이 생성됩니다. 이것이 예상된 것입니까? journactl보통 문자를 주세요.

답변1

시스템 로그 데이터는 일반 텍스트로 저장되지 않습니다. 이 도구를 통해 journalctl읽어야 합니다 . 원하는 경우 다음을 사용하여 strace파일이 실제로 읽혀지고 있는지 확인할 수 있습니다 journalctl./run/log/journal

strace journalctl 2>&1 | grep /run/log/journal/

관련 정보