-
Notifications
You must be signed in to change notification settings - Fork 490
Native mac os system source 4212 #4423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native mac os system source 4212 #4423
Conversation
1d73574
to
0da1cef
Compare
1e3f048
to
4b8bec2
Compare
Tested both drivers on my MacBook, including some of the parameters, and they worked as expected. My favorite parameter was: read-old-records(no), as this way syslog-ng did not try to read millions of logs from mid March :-) |
4b8bec2
to
79acf07
Compare
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
6189a4e
to
f171bfc
Compare
Signed-off-by: Hofi <hofione@gmail.com>
f171bfc
to
22f24a4
Compare
Signed-off-by: Hofi <hofione@gmail.com>
22f24a4
to
2b832f0
Compare
Signed-off-by: Hofi <hofione@gmail.com>
2b832f0
to
a11ba9d
Compare
Signed-off-by: Hofi <hofione@gmail.com>
a11ba9d
to
6fad7a7
Compare
@kira-syslogng test this please; |
5e2b652
to
ed0fb7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created the issue #4786 that stands for adding the generic metrics (or some of the metrics) here to the LogThreadedSourceDriver as it would be potentially quite huge of a change impacting multiple modules.As for the code and the documentation it is fine by me. (Also it looks like that based on our discussions that the ObjC exception only escapes the catch clause when compiled in debug mode, and youve made it so that an actual error will be shown inside the configuration file if the predicate has invalid syntax)
With this I approve youre PR hopefully @bazsi @alltilla it is fine by you
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
…port Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
- This is a wrapper around the OS command line "log stream" command that can provide live log stream feed, unfortunately, there's no public API to get the same programmatically - darwin-oslog defaults are not duplicated anymore - Added default filter predicate to darwin-oslog Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
… C++ and ObjC modules that could lead further libtool issues Note, the original error was libtool: link: unable to infer tagged configuration libtool: error: specify a tag with '--tag' though the --tag CC is already presented in the config files Needs further investigation, but for now this will solve the issue in most of the cases. Signed-off-by: Hofi <hofione@gmail.com>
…ctly - forcing usage of clang for ObjC code now both in autotools and cmake compilations Signed-off-by: Hofi <hofione@gmail.com>
…-worker Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
…changes Signed-off-by: Hofi <hofione@gmail.com>
…e Makefile Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
…g parsing phase NOTE: This one still cannot prevent syslog-ng to crash on certain filter predicate parsing issues, this I consider as an Apple bug, anyway, it crashes at least immediately during config parsing not at runtime now :S Signed-off-by: Hofi <hofione@gmail.com>
… darwin-oslog-stream source - Release note is updated as well Signed-off-by: Hofi <hofione@gmail.com>
ed0fb7d
to
05d03a5
Compare
system()
,darwin-oslog()
,darwin-oslog-stream()
sources: Added 2 darwin OSLog based sourcesdarwin-oslog()
anddarwin-oslog-stream()
.'darwin-oslog()' replaced the earlier file source based solution with a native OSLog framework based one, and is automatically used in the
system()
source on darwin platform if the darwinosl plugin is presented.This plugin available only on macOS 10.15 Catalina and above, the first version that has the OSLog API.
darwin-oslog
This is a native OSLog Framework based source to read logs from the local store of the unified logging system on darwin OSes.
For more info, see https://developer.apple.com/documentation/oslog?language=objc
The following parameters can be used for customization:
(eventType == 'logEvent' || eventType == 'lossEvent' || eventType == 'stateEvent' || eventType == 'userActionEvent') && (logType != 'debug')
man log
(Use with care, though lower delay time can increase log feed performance, at the same time could lead to a heavy system load!)
NOTE: the persistent OSLog store is not infinite, depending on your system setting usually, it keeps about 7 days of logs on disk, so it could happen that the above options cannot operate the way you expect, e.g. if syslog-ng was stopped for about more then a week it could happen that will not be able to restart from the last saved bookmark position (as that might not be presented in the persistent log anymore)
darwin-oslog-stream
This is a wrapper around the OS command line "log stream" command that can provide a live log stream feed.
Unlike in the case of
darwin-oslog()
the live stream can contain non-persistent log events too, so take care, there might be a huge number of log events every second that could put an unusual load on the device running syslog-ng with this source.Unfortunately, there's no public API to get the same programmatically, so this one is implemented using a program() source.
Possible parameters:
a string that can contain all the possible params the macOS
log
tool can accept, please see,log --help stream
for full reference, andman log
for more details.IMPORTANT: the parameter --style is used internally (defaults to
ndjson
), so it cannot be overridden, please use other sysylog-ng features (templates, rewrite rules, etc.) for final output formattingdefault value:
--type log --type trace --level info --level debug
, you can use `def-osl-stream-params
` for referencing it if you wish to keep the defaults when you add your ownSigned-off-by: Hofi hofione@gmail.com