You are not logged in.

#1 2013-09-11 03:13:57

train_wreck
Member
Registered: 2011-10-22
Posts: 97

simple question about systemd console output - can i get a timestamp?

hello. with the old syslog program, sending the log to a console used to yield essentially the same output as /var/log/everything.log, critically including timestamps before each entry. Now with systemd, enabling console output just gives each entry by itself, so you can't tell if you're looking at 5 seconds worth of activity or 5 days. any way a timestamp can be added here? i'd find that useful on my servers, as I have a screen connected to them but no keyboard.

thanks

Offline

#2 2013-09-11 03:44:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: simple question about systemd console output - can i get a timestamp?

Console output of what? Please post the exact command you're using and the output.

# journalctl -b
-- Logs begin at Sun 2013-08-11 17:23:43 CEST, end at Wed 2013-09-11 05:36:39 CEST. --
Sep 10 19:11:44 localhost systemd-journal[36]: Runtime journal is using 184.0K (max 49.8M, leaving 74.8M of free 498.4M, current limit 49.8M).
Sep 10 19:11:44 localhost systemd-journal[36]: Runtime journal is using 188.0K (max 49.8M, leaving 74.8M of free 498.4M, current limit 49.8M).
Sep 10 19:11:44 localhost kernel: Initializing cgroup subsys cpuset
Sep 10 19:11:44 localhost kernel: Initializing cgroup subsys cpu
Sep 10 19:11:44 localhost kernel: Initializing cgroup subsys cpuacct
Sep 10 19:11:44 localhost kernel: Linux version 3.11.0-1-ARCH (tobias@testing-i686) (gcc version 4.8.1 20130725 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Sep 3 0
Sep 10 19:11:44 localhost kernel: e820: BIOS-provided physical RAM map:
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009f7ff] usable
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x000000000009f800-0x000000000009ffff] reserved
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x0000000000100000-0x000000003f6effff] usable
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x000000003f6f0000-0x000000003f6fafff] ACPI data
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x000000003f6fb000-0x000000003f6fffff] ACPI NVS
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x000000003f700000-0x000000003f77ffff] usable
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x000000003f780000-0x000000003fffffff] reserved
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec0ffff] reserved
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x00000000ff800000-0x00000000ffbfffff] reserved
Sep 10 19:11:44 localhost kernel: BIOS-e820: [mem 0x00000000fffffc00-0x00000000ffffffff] reserved

<cut>

Sep 10 19:11:56 black kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sep 10 19:11:56 black systemd-logind[164]: Watching system buttons on /dev/input/event2 (Power Button)
Sep 10 19:11:56 black systemd-logind[164]: Watching system buttons on /dev/input/event1 (Power Button)
Sep 10 19:12:00 black login[167]: pam_unix(login:session): session opened for user karol by LOGIN(uid=0)
Sep 10 19:12:00 black systemd[1]: Starting user-1000.slice.
Sep 10 19:12:00 black systemd[1]: Created slice user-1000.slice.
Sep 10 19:12:00 black systemd[1]: Starting User Manager for 1000...
Sep 10 19:12:00 black systemd-logind[164]: New session 1 of user karol.
Sep 10 19:12:00 black systemd[1]: Starting Session 1 of user karol.
Sep 10 19:12:00 black systemd[191]: pam_unix(systemd-shared:session): session opened for user karol by (uid=0)
Sep 10 19:12:00 black systemd[1]: Started Session 1 of user karol.
Sep 10 19:12:00 black login[167]: LOGIN ON tty1 BY karol
Sep 10 19:12:00 black systemd[191]: Failed to open private bus connection: Failed to connect to socket /run/user/1000/dbus/user_bus_socket: No such file or dir
Sep 10 19:12:00 black systemd[191]: Mounted /sys/kernel/config.
Sep 10 19:12:01 black systemd[191]: Stopped target Sound Card.
Sep 10 19:12:01 black systemd[191]: Starting Default.
Sep 10 19:12:01 black systemd[191]: Reached target Default.
Sep 10 19:12:01 black systemd[191]: Startup finished in 619ms.
Sep 10 19:12:01 black systemd[1]: Started User Manager for 1000.
Sep 10 19:12:00 black dhcpcd[168]: eth0: leased 192.168.1.4 for 259200 seconds
Sep 10 19:12:00 black dhcpcd[168]: eth0: adding host route to 192.168.1.4 via 127.0.0.1
Sep 10 19:12:00 black dhcpcd[168]: eth0: adding route to 192.168.1.0/24
Sep 10 19:12:00 black dhcpcd[168]: eth0: adding default route via 192.168.1.1

<cut>

(No idea why there's 'Sep 10 19:12:01' followed by 'Sep 10 19:12:00')

Offline

#3 2013-09-11 03:51:38

train_wreck
Member
Registered: 2011-10-22
Posts: 97

Re: simple question about systemd console output - can i get a timestamp?

not a command, /etc/systemd/journald.conf has 2 options i'm using

ForwardToConsole=yes
TTYPath=/dev/tty12

doing this gives the same entry you posted, minus the first date/time and then the hostname i.e. what's printed on the screen would be this:

systemd-journal[36]: Runtime journal is using 184.0K (max 49.8M, leaving 74.8M of free 498.4M, current limit 49.8M).
systemd-journal[36]: Runtime journal is using 188.0K (max 49.8M, leaving 74.8M of free 498.4M, current limit 49.8M).
kernel: Initializing cgroup subsys cpuset
kernel: Initializing cgroup subsys cpu
kernel: Initializing cgroup subsys cpuacct
kernel: Linux version 3.11.0-1-ARCH (tobias@testing-i686) (gcc version 4.8.1 20130725 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Sep 3 0
kernel: e820: BIOS-provided physical RAM map:

and so on..


oh and by the way, i've noticed that exact same mis-ordering of entries when using journalctl... no idea why that happens

Last edited by train_wreck (2013-09-11 03:52:26)

Offline

Board footer

Powered by FluxBB