Web access logging (inclusive API)?

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Web access logging (inclusive API)?

Post by sander »

Hi,

Is it possible to have logging of access to SABnzbd' Web interface, including access via the API? I would like to see some logging (date/time, source IP, URL requested including API-key filled out), just like Apache and thttpd have their logging.

My log settings are on "+Debug", but cherrypy.log only shows cherrypy startup stuff, and sabnzbd.log only shows "API Key missing, please enter the api key from Config->General into your 3rd party program:" (without anything after the ":").

So ... am I missing a setting, or a file, or is this a feature request?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Web access logging (inclusive API)?

Post by shypike »

-w1
Although it will only log to the console, not to the file.
Not fully intentional, some logging went wrong after we upgraded to a later CherryPy.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Web access logging (inclusive API)?

Post by sander »

OK, works. Results:

Code: Select all

2a00:cd8:...:b21 - - [13/Jan/2012:21:03:49] "POST /sabnzbd/api HTTP/1.1" 200 903 "" "Apache-HttpClient/UNAVAILABLE (java 1.4)"

2a00:cd8:...:54ab - <removed> [13/Jan/2012:21:05:25] "GET / HTTP/1.1" 200 4521 "" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/10.10 Chromium/14.0.835.202 Chrome/14.0.835.202 Safari/535.1"
The first line is the API call. Is it on purpose the API-url is chopped and no key and no method is seen?

The second line is a webinterface call ... looks very informative. The <removed>: that's the username/password?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Web access logging (inclusive API)?

Post by shypike »

Username, yes. Password no. At least the password is not shown.

The app sending the API request probably just sends less and shorter headers.
The amount of info exposed by browsers borders on the obscene.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Web access logging (inclusive API)?

Post by sander »

Thank you. I think the -w1 is enough for debugging purposes.
Post Reply