Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i'm using polipo (proxy server) for local caching.

is there a way to log all access through polipo just like urlsnarf or other web server log file do?

logFile = "/tmp/access.log"
logLevel = ? # what should i fill to log all url?

and if possible, get cached file location also

output for 0xFF is something like this, it does not always show the requested url:

Couldn't parse last-modified: Sat, 23 Feb 2013 16:25:16 +0100
Uncacheable object http://nekovm.org/_media/neko-2.0.0.tar.gz (2120)
Superseding object: http://nekovm.org/_media/neko-2.0.0.tar.gz (200 425539 -1 (none) -> 200 425539 -1 (none))
Unsupported Cache-Control directive post-check -- ignored.
Unsupported Cache-Control directive pre-check -- ignored.
Couldn't parse last-modified: Sat, 23 Feb 2013 16:25:16 +0100
Uncacheable object http://nekovm.org/_media/neko-2.0.0.tar.gz (2120)
Superseding object: http://nekovm.org/_media/neko-2.0.0.tar.gz (200 425539 -1 (none) -> 200 425539 -1 (none))
Vary header present (Accept-Encoding).
Vary header present (Accept-Encoding).
Vary header present (Accept-Encoding).
Superseding object: http://opalrb.org/opal-parser.js (206 709851 1363984598 (none) -> 206 709851 1363984598 (none))
Vary header present (Accept-Encoding).
Superseding object: http://opalrb.org/opal-parser.js (200 709851 1363984598 (none) -> 200 709851 1363984598 (none))
Vary header present (Accept-Encoding).
Superseding object: http://opalrb.org/opal-parser.js (200 709851 1363984598 (none) -> 200 709851 1363984598 (none))
Vary header present (Accept-Encoding).
Superseding object: http://opalrb.org/opal-parser.js (200 709851 1363984598 (none) -> 200 709851 1363984598 (none))
Vary header present (Accept-Encoding).
Superseding object: http://opalrb.org/opal-parser.js (200 709851 1363984598 (none) -> 200 709851 1363984598 (none))
Vary header present (Accept-Encoding).
Vary header present (Accept-Encoding).
Vary header present (Accept-Encoding).
Uncacheable object http://www.youtube.com/?hl=en&gl=US (2050)
share|improve this question
1  
have you tried logLevel=0xFF ? I just found in google search – Rahul Patil May 4 '13 at 2:51
    
yes i have, but it still doesn't always show the requested urls – Kokizzu May 4 '13 at 3:49
    
Do you want to trace log only for testing purpose ? – Rahul Patil May 4 '13 at 4:32
1  
would you like to try different proxy server ? – Rahul Patil May 4 '13 at 4:39
1  
I had work with proxy i.e safesquid , it has many log level you can check this link safesquid.com/book/export/html/255 – Rahul Patil May 4 '13 at 4:42

The location where the logs go is controlled by the configuration variables logFile and logSyslog. If logSyslog is true, error messages go to the system log facility given by logFacility. If logFile is set, it is the name of a file where all output will accumulate. If logSyslog is false and logFile is empty, messages go to the error output of the process (normally the terminal). The variable logFile defaults to empty if daemonise is false, and to /var/log/polipo otherwise. The variable logSyslog defaults to false, and logFacility defaults to user. The amount of logging is controlled by the variable logLevel. Please see the file log.h in the Polipo sources for the possible values of logLevel.

solved?

share|improve this answer

As per polipo -v Max Loglevel is 0xFF

logLevel integer 0x7 Logging level (max = 0xFF)

Reference Link

share|improve this answer

To enable logging, the manual states that:

2.1.3 Logging

When it encounters a difficulty, Polipo will print a friendly message. The location where these messages go is controlled by the configuration variables logFile and logSyslog. If logSyslog is true, error messages go to the system log facility given by logFacility. If logFile is set, it is the name of a file where all output will accumulate. If logSyslog is false and logFile is empty, messages go to the error output of the process (normally the terminal).

The variable logFile defaults to empty if daemonise is false, and to ‘/var/log/polipo’ otherwise. The variable logSyslog defaults to false, and logFacility defaults to ‘user’.

If logFile is set, then the variable logFilePermissions controls the Unix permissions with which the log file will be created if it doesn’t exist. It defaults to 0640.

The amount of logging is controlled by the variable logLevel. Please see the file ‘log.h’ in the Polipo sources for the possible values of logLevel.

Keeping extensive logs on your users browsing habits is probably a serere violation of their privacy. If the variable scrubLogs is set, then Polipo will scrub most, if not all, private information from its logs.

Following on from that, log.h (from here) has the following levels:

#define L_ERROR 0x1
#define L_WARN 0x2
#define L_INFO 0x4
#define L_FORBIDDEN 0x8
#define L_UNCACHEABLE 0x10
#define L_SUPERSEDED 0x20
#define L_VARY 0x40
#define L_TUNNEL 0x80
#define LOGGING_DEFAULT (L_ERROR | L_WARN | L_INFO)
#define LOGGING_MAX 0xFF

So, for example, if you wanted to see all of the log messages in a file, the recommended configuation is (in /etc/polipo/config):

  logFile=/var/log/polipo
  logLevel=4
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.