Skip to content
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

add logger config to pfdns.conf #3638

Merged
merged 1 commit into from
Oct 5, 2018
Merged

add logger config to pfdns.conf #3638

merged 1 commit into from
Oct 5, 2018

Conversation

julsemaan
Copy link
Collaborator

Description

Allows to configure pfdns logging by using our standard golang logging library

Impacts

pfdns logging

Issue

fixes #3635

Delete branch after merge

YES

NEWS file entries

Enhancements

  • pfdns now uses the PacketFence standard Golang logging library

@MuriloCalegari
Copy link

MuriloCalegari commented Oct 6, 2018

Hi!

Does this change the actual output of pfdns logs in the file? We have a script that relies on how the serve dns logs are written today, is it possible that this patch is going to brake it?

@fdurand
Copy link
Member

fdurand commented Oct 6, 2018

Yes it will but to have the same output as before you will need to set the log level to DEBUG.

@MuriloCalegari
Copy link

Hi,

I've just recently updated PacketFence to v8.2 and set pfdns.conf log level to DEBUG. After configreload hard and restarting pfdns service I see on pfdns.log:

Nov 9 08:52:11 prometeu pfdns: Using configuration set log level: DEBUG

But I can only see these types of logs:

Nov 9 08:59:51 prometeu pfdns: 192.168.21.41 - [09/Nov/2018:08:59:51 -0200] "A IN www.google.com. udp 32 false 512" NOERROR qr,aa,rd 48 6.974433ms

Logs like Returned portal or serve dns are not being registered.

@MuriloCalegari
Copy link

This is the complete output of the pfdns.log initialization:

Nov 9 09:14:29 prometeu pfdns: Using configuration set log level: DEBUG
Nov 9 09:14:29 prometeu pfdns: Using configuration set log level: DEBUG
Nov 9 09:14:29 prometeu pfdns: .:54
Nov 9 09:14:29 prometeu pfdns: .:53
Nov 9 09:14:29 prometeu pfdns: 2018/11/09 09:14:29 [INFO] CoreDNS-0.9.9
Nov 9 09:14:29 prometeu pfdns: 2018/11/09 09:14:29 [INFO] linux/amd64, go1.9.3,
Nov 9 09:14:29 prometeu pfdns: CoreDNS-0.9.9
Nov 9 09:14:29 prometeu pfdns: linux/amd64, go1.9.3,

julsemaan added a commit that referenced this pull request Nov 9, 2018
Seems the rsyslog filter on the programname contains isn't working so this worksaround it.

In reference to #3638 (comment)
julsemaan added a commit that referenced this pull request Nov 9, 2018
Seems the rsyslog filter on the programname contains isn't working so this worksaround it.

In reference to #3638 (comment)
@julsemaan
Copy link
Collaborator Author

@LordeRamen

I've pushed a fix for that, it seems that the rsyslog rule on the programname only worked with equals so I made a patch so pfdns initializes the logging framework with the right process name (defaults to the binary path)

Tomorrow, the new binary will be in the maintenance along with the updated rsyslog configuration, apply the following instructions:

# /usr/local/pf/addons/pf-maint.pl
# cp /usr/local/pf/conf/pfdns.conf.example /usr/local/pf/conf/pfdns.conf
# /usr/local/pf/bin/pfcmd service pf restart

@MuriloCalegari
Copy link

MuriloCalegari commented Nov 12, 2018

@julsemaan

Hi, it's working now.

I noticed that pfdns.log moved to a .gz file at an unusual time (it used to be around 3 A.M., now it just did it at 9:22 A.M.), and also there are some logs from day 09 at day 12 file. What are the new rules that controls this?

@julsemaan
Copy link
Collaborator Author

This is the logrotate configuration in /etc/logrotate.d/ but I don't believe this change should have done anything to the time its being invoked

@satkunas satkunas deleted the feature/pfdns-logger branch May 15, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pfdns doesn't use the logging lib, uses fmt instead
3 participants