Am 28.05.2012 20:11, schrieb ArtemGr: > Tommi Mäkitalo<tommi@...> writes: >>> Of course can rotating be done by the OS. But if tntnet does it, tntnet >>> do not need to be restarted. It might be a cleaner solution. >>> >>> Here everything goes into the accessLog. But errorLog is unused. It >>> looks like it was never used. I will remove it. And accessLog is not >>> truncated. It works here like before and like it should work. >>> >>> Tommi >> Not quite true. "errorLog" is used for stderr. Stderr is redirected to >> errorLog, so if a application writed to std::cerr, it is written into >> errorLog. But this happens only when tntnet is started in daemon mode. >> And as I read in the code, it is really truncated. But that is nothing >> new. It is just a bug, which I will fix. >> >> Tommi > Here *everything goes to the errorLog*: > > My conf: > <accessLog>/var/log/tntnet/tntnet.log</accessLog> > <errorLog>/var/log/tntnet/error.log</errorLog> > <logging> > <rootlogger>INFO</rootlogger> > <loggers> > <logger><category>tntnet</category><level>WARN</level></logger> > </loggers> > </logging> > > Tntnet is started with: "tntnet /etc/tntnet/tntnet.conf.xml". > > A sample from "error.log": > 2012-05-28 22:09:29.16583 [7466.140277164074752] INFO component.img2.service > - 1 > 2012-05-28 22:09:29.16585 [7466.140277164074752] INFO component.img2.service > - 2 > 2012-05-28 22:09:29.16587 [7466.140277164074752] INFO component.img2.service > - 3 > 2012-05-28 22:09:29.17578 [7466.140277164074752] ERROR component.img2.service > - > Error using img2.scaleService: Operation cannot be accomplished in current > state > > "tntnet.log" is empty. > > Ok - this is a little different. There are 2 kinds of log files. One is the logfile from cxxtools-logger and the other is the accessLog.
The cxxtools-logger is configurable with categories and log levels. You can log to a file and configure rolling or log via udp to the network. You can add a <file>something.log</file> into the <logging> section. The in outputs to a file. If you do not configure a file (or a host using <host>), it logs to stderr. And as I said, <errorLog> tells tntnet, where to print output to stderr. Therefore you get the output of the logger to the errorLog. The accessLog is something very different. It prints every http access in a single line to a file in the same format as e.g. apache does, so you can use tools like webalizer to collect statistics from that. The strange thing here is, why that file is empty in your configuration. It shouldn't be. In my test it looks like this: 127.0.0.1 - - [28/May/2012:19:26:46 +0200] "GET / HTTP/1.0" 200 124 "-" "ApacheBench/2.3" 127.0.0.1 - - [28/May/2012:19:27:05 +0200] "GET /foo HTTP/1.1" 200 124 "-" "curl/7.21.7 (x86_64-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.3.0 zlib/1.2.5 libidn/1.22 libssh2/1.2.7" My logging configuration is here: <logging> <rootlogger>INFO</rootlogger> <loggers> <logger> <category>tntnet</category> <level>INFO</level> </logger> <logger> <category>component.foo</category> <level>INFO</level> </logger> </loggers> <file>tntnet.log</file> <maxfilesize>10M</maxfilesize> <maxbackupindex>2</maxbackupindex> </logging> This instructs the logger not to print to stderr but to the file tntnet.log. Hence the file configured via errorLog is empty. Also rolling is configured here. After the tntnet.log reaches 10M, it is rolled to tntnet.log.0 and a new tntnet.log is created. The renaming happens until tntnet.log.2, which is then deleted. So the problem is your accessLog. I have currently no idea, why it is not written. Tommi ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
