Hi, all. I try logging some message of my console application.
Just like syslog daemon in linux, I want to change and apply facility and level printing if requested.
So, I just try to use syslog API and os_log API both of them. And try to change syslog.conf, add asl.configuration in /etc/asl directory But, it seems not to be applied.
Only I can see, log messages can be gotten by using "log" command not saved to file.
How can i config just like syslog system in linux and apply this?
Thansk.
but actually
log collectisn't what i want.
Yes it is.
Where is the log file what i config?
There is no “log file”. Rather, there’s a log store, and by enabling persistence your log entries end up in that store:
-
If you want to grab the log store from a user’s machine, use
log collect. -
If you want to extract log entries from a log store (a
.logarchivepackaged document), uselog showwith the--archiveoption. -
To extract just your log entries, use
--predicate. -
If you’re a big fan of the old school system log format, pass
--style syslogto get that output style. -
If you want to monitor log entries in real time (à la
tail -fwith traditional log files), uselog stream. It supports--predicateand--style, just likelog show.
To reiterate, the logging system does not work in terms of plain text log files. This isn’t an omission but rather a deliberate decision to help minimise write counts.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"