Hi, On a related note - please join us over at https://community.icinga.com/ <https://community.icinga.com/> where we developers can help you with the log() calls and its handling for debugging.
You can also use it as mailing list if you prefer that, see the recent announcement blog post here: https://icinga.com/2019/01/28/welcome-to-our-new-community-platform/ <https://icinga.com/2019/01/28/welcome-to-our-new-community-platform/> Cheers, Michael > On 18. Mar 2019, at 23:07, Václav Mach <ma...@cesnet.cz> wrote: > > On 3/18/19 9:47 PM, Antony Stone wrote: >> Eh? >> The code is not "run" when doing "icinga2 daemon -C" - there's no output to >> /var/log/icinga2/icinga2.log, and there's no output from the log() functon >> calls on the console - it just reports the number of different types of >> ConfigItems etc (and any syntax errors if there are any). > > As far as I know, you won't get any output from log() to log files (I'd also > appreciate it, if anyone knows to set this up), but you do get it on console > when running "icinga2 daemon -C". > > Try to include some simple config file into your whole icinga configuration: > > arr = [1, 2, 3] > obj = { "key1" = "value1", "key2" = "value2", "key3" = "value3" } > > log(arr) > log(obj) > > This should get you output when running the command mentioned above. > >> What I was expecting log() to do was to put something into the standard >> Icinga2 log file when the function call got executed, so that I could see >> what >> the code was doing at the time. > > That would make sense. Try looking at the > https://icinga.com/docs/icinga2/latest/doc/18-library-reference/#log > > It explains at leats a bit. You could also get some info in icinga2 console: > > <3> => log > { > arguments = [ "severity", "facility", "value" ] > deprecated = false > name = "System#log" > side_effect_free = false > type = "Function" > } > > According to the docs, it should be possible. > >> As it is, all I can use for now is the output of the Notification, which >> sends >> me an email. Effective, but a bit slow and a bit tedious... >> Antony. > > -- > Václav Mach > tel: +420 234 680 206 > CESNET, z.s.p.o. > www.cesnet.cz > > _______________________________________________ > icinga-users mailing list > icinga-users@lists.icinga.org > https://lists.icinga.org/mailman/listinfo/icinga-users
_______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users