OS X 10.8 SDK: Apple System Log API no log formatting
| Originator: | ScrimpyCat | ||
| Number: | rdar://14680976 | Date Originated: | Aug 8 2013 |
| Status: | Closed | Resolved: | Added to public API in 10.9 |
| Product: | OS X SDK | Product Version: | 10.8.4 |
| Classification: | Enhancement | Reproducible: | NA |
Summary: The public ASL API uses a set formatting for the message and time. However the private portions of the ASL API actually do support different formatting. see: asl_format_message from http://www.opensource.apple.com/source/Libc/Libc-825.26/gen/asl_msg.h The formatting options are extended up to the adding of a file (so certain files can have particular formatting). see: asl_add_output from http://www.opensource.apple.com/source/Libc/Libc-825.26/gen/asl_private.h The issue here is the public API for adding a file does not accept formatting options and instead opts to use a specific options. see: asl_add_log_file from http://www.opensource.apple.com/source/Libc/Libc-825.26/gen/asl.c It simply calls asl_add_output with ASL_MSG_FMT_STD, ASL_TIME_FMT_LCL for the formatting. Comparing this with the command line tool equivalent (Syslog), it supports formatting through the -F option. see: -F format in http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/syslog.1.html Workaround: The current workaround is to either live with the fixed formatting when using the API, run the Syslog program, or to access the private API function asl_add_output. Suggested Solution: To make the asl_add_output function public, or to be able to change the formatting somehow.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!