opnsense / dhcp6c

OPNsense WIDE-DHCPv6 client
Other
22 stars 30 forks source link

Full Debug output is not being sent to syslog. #15

Closed marjohn56 closed 3 years ago

marjohn56 commented 4 years ago

if '-D' is used to get full debug output only normal debug output is sent, running from the shell in foreground mode then full debug output can be seen. Has there been a syslog change that may have affected this?

AdSchellevis commented 4 years ago

@marjohn56 when was the last time the output was there?

marjohn56 commented 4 years ago

THAT is a really good question.. no idea, I've not had reason to wander in that area for a long time. I'll do some messing about and see if I can work out when. Certainly it was working in 19.1.*, at least the early editions. Are there any archives I can access and I'll install them one by one to try and find out where it fell over.

AdSchellevis commented 4 years ago

In 19.7 we switched to syslog-ng, if you have a one-liner that should output something to the log, I can take a look at my end to see where it goes.

marjohn56 commented 4 years ago

It's odd, I've checked dhcp6c and log_info is being shown, but anything sent as log_debug is not.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Ad Schellevis notifications@github.com Sent: Saturday, October 12, 2019 4:26:49 PM To: opnsense/dhcp6c dhcp6c@noreply.github.com Cc: Martin Wasley Martin@queens-park.com; Mention mention@noreply.github.com Subject: Re: [opnsense/dhcp6c] Full Debug output is not being sent to syslog. (#15)

In 19.7 we switched to syslog-ng, if you have a one-liner that should output something to the log, I can take a look at my end to see where it goes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opnsense/dhcp6c/issues/15?email_source=notifications&email_token=AEJBPJSE6H6657OSH6RADJ3QOHUDTA5CNFSM4JACRVP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCB23I#issuecomment-541334893, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEJBPJSMQIABZ4B6XMPIXZDQOHUDTANCNFSM4JACRVPQ.

AdSchellevis commented 4 years ago

I don't see any obvious differences between the old and new logging. You could try to capture all entries and send them to a remote log server to see if it actually passes syslog-ng.

marjohn56 commented 4 years ago

OK, I've searched my downloads backup folder and have a 19.1 install file. I'll put that onto my test system and see what gives. If it's got the same problem in 19.1 then I guess it must be a dhcp6c issue, but I've looked at the code there and nothing seems out of place.

marjohn56 commented 4 years ago

Even more bizarre. Sending to a syslog server I see nothing from dhcp6c at all.

Also checked in 19.1.4, no Debug level 2 log there either.

marjohn56 commented 4 years ago

OK, some progress before I have to go and to some real work. In the syslog server I was seeing nothing from dhcp6c, I added dhcp6c to the 'routing' $logfacilities in core.inc and now I see it. I can see full debug info there, ( Once I had allowed Debug level messages ) so its definitely sending debug stuff, it's just not showing up in the normal Log Files -> General on the web interface.

AdSchellevis commented 4 years ago

ok, so we miss dhcp6c if I understand you correctly, shouldn't it go here?

https://github.com/opnsense/core/blob/398e00c0bc06ee20e2d866ccc20dc58700196909/src/etc/inc/plugins.inc.d/core.inc#L181

fichtner commented 4 years ago

https://github.com/opnsense/core/commit/2e314c016e12 looks like not everything lands in system log, maybe due to debug level? the move to system log was intentional, it shouldn't go to dhcpd/dhcrelay

AdSchellevis commented 4 years ago

@fichtner I don't think debug was ever logged to system.log, I'm unsure we want that either, since services like devd can be very loud. At least we have a reason now, we could send debug output for selected services to system.log (I think we only need to add a line in the earlier mentioned log).

I forgot about the move to system.log, you're right, it should stay where it is now.

marjohn56 commented 4 years ago

The only reason I was looking for the Debug output was that there was a question about prefix length on the forum, and I wanted to show the OP how to confirm the prefix length in the logs, just to be 100% sure. I think apart from trying to get the debug output to the system log IF required, an adjustment to dhcp6c itself is required so that it sends the prefix info to the INFO log rather than the DEBUG log; at present the IA etc are sent to the INFO log but prefix is not. It's a quick fix and I'll do it and issue a PR for dhcp6c.

marjohn56 commented 4 years ago

There's another option that might work, I'll have to play to see if it does. When the 'D' flag is set in dhcp6c settings, when it gets to the d_printf() function where it sends the logs to syslog I could force a change to the level

Issued #17

marjohn56 commented 4 years ago

@fichtner I don't think debug was ever logged to system.log, I'm unsure we want that either, since services like devd can be very loud. At least we have a reason now, we could send debug output for selected services to system.log (I think we only need to add a line in the earlier mentioned log).

I forgot about the move to system.log, you're right, it should stay where it is now.

Did this ever get resolved? I have a feeling my second commit ( which strangely is there on my second even though it's a different PR ) is trying to fix the same thing. I'm going around in ever decreasing circles.