sipcapture / heplify-server

HEP Capture Server for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
183 stars 85 forks source link

[Bug] heplify-server start successfully but heplify-server.log file not create ? #313

Closed hangocanh2303 closed 4 years ago

hangocanh2303 commented 4 years ago

I'm using CentOS Linux release 7.7.1908 (Core) I'm install heplify-server via this link: https://github.com/sipcapture/homer/wiki/homer-seven-setup#the-heplify-capture-agent Result: heplify-server start successfully but heplify-server.log file not create image

Here is heplify-server.toml file: HEPAddr = "0.0.0.0:9060" HEPTCPAddr = "" HEPTLSAddr = "0.0.0.0:9060" ESAddr = "" ESDiscovery = false LokiURL = "" LokiBulk = 200 LokiTimer = 4 LokiBuffer = 100000 LokiHEPFilter = [] ForceHEPPayload = [] PromAddr = "0.0.0.0:9096" PromTargetIP = "" PromTargetName = "" DBShema = "homer7" DBDriver = "postgres" DBAddr = "localhost:5432" DBUser = "homer_user" DBPass = "FT5QRbUOflpHMrWqXGUwu39r9cQ" DBDataTable = "homer_data" DBConfTable = "homer_config" DBBulk = 200 DBTimer = 4 DBBuffer = 400000 DBWorker = 32 DBRotate = true DBPartLog = "2h" DBPartSip = "1h" DBPartQos = "6h" DBDropDays = 14 DBDropDaysCall = 0 DBDropDaysRegister = 0 DBDropDaysDefault = 0 DBDropOnStart = false Dedup = false DiscardMethod = ["OPTIONS","NOTIFY"] AlegIDs = [] CustomHeader = [] SIPHeader = [] LogDbg = "hep,sql" LogLvl = "info" LogStd = false LogSys = false Config = "./heplify-server.toml" ConfigHTTPAddr = ""

negbie commented 4 years ago

Mby some permission issue?

hangocanh2303 commented 4 years ago

Mby some permission issue?

No, I changed permission of heplify-server folder to 777 and log file still not create

negbie commented 4 years ago

Does LogSys = true work?

hangocanh2303 commented 4 years ago

Does LogSys = true work?

No, When I set LogSys = true, no log in /var/log/heplify-server.log

negbie commented 4 years ago

LogSys = true should write into syslog, normally under /var/log/syslog

hangocanh2303 commented 4 years ago

LogSys = true should write into syslog, normally under /var/log/syslog @negbie No syslog folder in /var/log

negbie commented 4 years ago

Red Hat family distributions (including CentOS and Fedora) use /var/log/messages and /var/log/secure

Maybe there?

negbie commented 4 years ago

I use for almost everything Debian and there it's /var/log/syslog

negbie commented 4 years ago

Since this seems to be an CentOS specific issue maybe someone else could help you out here? Let tag this issue properly.

hangocanh2303 commented 4 years ago

I use for almost everything Debian and there it's /var/log/syslog

@negbie /var/log/messages printed some log of heplify, I will check it later. But, I don't know why if syslog = false, heplify-server.log not create. It seem like centOS bug.

hangocanh2303 commented 4 years ago

here is some log in /var/log/message Feb 14 20:14:54 /opt/heplify-server/heplify-server[27016]: server.go:83: start heplify-server 1.15 with config.HeplifyServer{HEPAddr:"0.0.0.0:9060", HEPTCPAddr:"", HEPTLSAddr:"0.0.0.0:9060", ESAddr:"", ESDiscovery:false, ESUser:"", ESPass:"", LokiURL:"", LokiBulk:200, LokiTimer:4, LokiBuffer:100000, LokiHEPFilter:[]int{}, ForceHEPPayload:[]int{}, PromAddr:"0.0.0.0:9096", PromTargetIP:"", PromTargetName:"", DBShema:"homer7", DBDriver:"postgres", DBAddr:"localhost:5432", DBUser:"homer_user", DBPass:"FT5QRbUOflpHMrWqXGUwu39r9cQ", DBDataTable:"homer_data", DBConfTable:"homer_config", DBBulk:200, DBTimer:4, DBBuffer:400000, DBWorker:32, DBRotate:true, DBPartLog:"2h", DBPartIsup:"6h", DBPartSip:"1h", DBPartQos:"6h", DBDropDays:14, DBDropDaysCall:0, DBDropDaysRegister:0, DBDropDaysDefault:0, DBDropOnStart:false, Dedup:false, DiscardMethod:[]string{"OPTIONS", "NOTIFY"}, AlegIDs:[]string{}, CustomHeader:[]string{}, SIPHeader:[]string{}, LogDbg:"hep,sql", LogLvl:"debug", LogStd:false, LogSys:true, Config:"/opt/heplify-server/heplify-server.toml", ConfigHTTPAddr:"", ConfigHTTPPW:"", Version:false} Feb 14 20:14:54 /opt/heplify-server/heplify-server[27016]: prometheus.go:38: expose metrics without or unbalanced targets Feb 14 20:14:54 /opt/heplify-server/heplify-server[27016]: rotator.go:331: start creating tables (2020-02-14 20:14:54.864650105 +0700 +07 m=+0.018368067) Feb 14 20:14:55 /opt/heplify-server/heplify-server[27016]: rotator.go:344: end creating tables (2020-02-14 20:14:55.544802807 +0700 +07 m=+0.698520771) Feb 14 20:14:55 /opt/heplify-server/heplify-server[27016]: postgres.go:62: postgres connection established

negbie commented 4 years ago

Looks good. Maybe you or someone else will find out why the normal log file can't be written on CentOS. For me it's currently to low prio so help is wanted.

systemcrash commented 4 years ago

My first thoughts are SELinux.

ls -Z /opt/heplify/heplify.log

Try to touch /opt/heplify/heplify.log as root the target logfile (then chown appropriately for heplify user:group) and systemctl restart heplify. See if that helps. If so, 99% certain it's SELinux perms.

negbie commented 4 years ago

Thank you. I hope this helps some other user!