sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
204 stars 79 forks source link

Where is the log? #499

Closed kosza closed 1 year ago

kosza commented 1 year ago

Hi,

I use VERSION 1.4.42 of Homer-app on Ubuntu bionic. I tried to debug sql queries but they are not written into the homer-app.log. Finally I found them in syslog. In the homer config I write direct syslog to false. I find syslog variable from the source. How it should be configured to use only homer-app.log?

  "system_settings": {
    "_loglevels": "can be: fatal, error, warn, info, debug, trace",
    "help": "Settings for HOMER logs",
    "hostname": "test_homer",
    "loglevel": "debug",
    "logname": "homer-app.log",
    "logpath": "/usr/local/homer/log",
    "logstdout": false,
    "logjson": false,
    "syslog": false,
    "uuid": "bb824ea9-ca50-4d91-a8aa-277025d2ea74"
  },

Other question: is it possible to log the final query string? Now there is unparsed query sting (from syslog): is it possible log the parameters too like pgsql? homer log:

Nov 11 10:26:12 test_homer homer-app[24455]: time="2022-11-11T10:26:12+01:00" level=info msg="SELECT * FROM \"hep_proto_1_call\"  WHERE (create_date between $1 AND $2 AND data_header->>'callid' in ($3,$4))" module=gorm type=sq
l

pgsql log:

2022-11-11 19:24:55.778 CET [53790] homer_user@homer_data LOG:  execute <unnamed>: SELECT * FROM "hep_proto_1_call"  WHERE (create_date between $1 AND $2 AND data_header->>'callid' in ($3,$4))
2022-11-11 19:24:55.778 CET [53790] homer_user@homer_data DETAIL:  parameters: $1 = '2022-11-11 17:06:39+01', $2 = '2022-11-11 17:24:59+01', $3 = '3759415355-521856983@10.95.136.171', $4 = '3759415
355-521856983@10.95.136.171_b2b-1'

Thanks for your help!

github-actions[bot] commented 1 year ago

Your report is appreciated. Please star this repository to motivate its developers! :star:

adubovikov commented 1 year ago

about PGSQL - this is prepared statement, there is no way to generate SQL because it will "regenerate" on the PG's site