logging

in java taillistener, how to handle more log files

混江龙づ霸主 提交于 2020-01-15 09:15:51
问题 I am using java taillistener to monitor my log files.Whenever log files are updated,it will print the log message.when motoring one or two log files,it working fine.But when trying to monitoring more file(say 10 files),there is no messages displayed in console even logs are updated in log file.My code is given below. ScheduledThreadPoolExecutor logMonitorThreadPoolExec; if (listOfFiles[i].isFile()) { files = listOfFiles[i].getName(); File pcounter_log = new File(files); Tailer logMessages =

Fluentd apache log format with multiple host ip

只谈情不闲聊 提交于 2020-01-15 09:08:49
问题 I have a little issue with fluend log parser. I have varnish server on which I have set up the X-Forwarded-For parameter to content the list of ip all the host stack a http request goes through. I use this to get information in varnishncsa logs. This is and example of log : "192.168.79.16, 192.22.10.22, 10.2.2.22 - - [13/Aug/2015:09:50:45 +0000] \"GET http://poc.mydomain.com/panier/payment/payline?notificationType=WEBTRS&token=1KB01BwKWdUhVj1222301439454223514 HTTP/1.1\" 401 0 \"-\" \"Java/1

Powershell Scheduled Tasks conflicts?

两盒软妹~` 提交于 2020-01-15 05:43:45
问题 I have scheduled two powershell scripts as tasks to run at 00:00. This morning I checked the event log and found that one of the scripts failed with the following exception: Failure. The error was: 'Failed to create log entry in: ‘C:\Users\SPSETU~1\AppData\Local\Temp\PowerShellLog.txt’. The error was: ‘The process cannot access the file 'C:\Users\SPsetupAdmin\AppData\Local\Temp\PowerShellLog.txt' because it is being used by another process.’.'. Can be the problem related to logs? Both the

Get SQL queries which are executed from SSIS package on SQL Server

╄→尐↘猪︶ㄣ 提交于 2020-01-15 05:36:47
问题 I have built a custom job log framework which logs all of the tasks which are execute in an SSIS package along with any error that surface. Once complete, an enhancement was requested to also store any SQL queries that the SSIS package executes on the SQL Server. This is not limited to only Execute SQL tasks, they are looking for ANY SQL queries that the pack runs. I am aware of the OnInformation logging that is part of the SSIS logging framework, but this only shows some of the query. Thanks

TraceListener headers and footers

拟墨画扇 提交于 2020-01-15 04:57:49
问题 When writing a custom TraceListener how can I force the writeheader, the data/messsage, and the writefooter to be one discreet record? Specifically the custom tracelisteners in question write to a non file based source, such as database or event stream. I need to either have the writeHeader, writefooter base methods in TraceListener be ignored or somehow packaged into a single write event. 回答1: Here is a good article on how custom TraceListener s work, which also explains when and wh

apache2.4.7 not logging “404 Not Found” pages to error.log

混江龙づ霸主 提交于 2020-01-15 02:45:57
问题 I've seen questions about how to not log 404 errors to the error log, this is the opposite. For some reason my apache installation does not log 404 errors to my error log (or to my access log for that matter). I have set the error log properly and see errors going to it, but when I access non-existent pages I simply get my 404 error - the access (but not the 404 error) shows up in the access.log, but I don't see anything in the error log (which makes it hard, for example, to debug why some

How to log unit test entry and leave in MSTest

拈花ヽ惹草 提交于 2020-01-14 22:47:56
问题 I'm using MSTest and I want to write log entry before test executes and after it finishes. Obviously I don't want to add custom logging code at the beginning and end of each test - it would only make the test unreadable and seemed like a lot of effort (I have > 500 tests) Using TestInitialize and TestCleanup seemed like the way to go but I can't get the test name. Does anyone knows how to do this? 回答1: In MSTest, the name of the test case is available in the test context property. So to

What is the fastest and safest way to append records to disk file in highly loaded .ashx http handler?

僤鯓⒐⒋嵵緔 提交于 2020-01-14 19:34:27
问题 What is the best option for writing (appending) records to file in highly parallel web environment in .net4 IIS7? I use ashx http handler to receive small portions of data that should be written to file quickly. First I used: using (var stream = new FileStream(fileName, FileMode.Append, FileAccess.Write, FileShare.ReadWrite, 8192)) { stream.Write(buffer, 0, buffer.Length); } But I noticed that some records were broken or incomplete, probably because of FileShare.ReadWrite. Next I tried to

NLog Configuration API: Using Layouts stored in variables

守給你的承諾、 提交于 2020-01-14 14:31:07
问题 My app creates a log for the application itself, so record when it was activated, and what happened at an application level. The application is centered around 'profiles' - the user loads a profile which tells the application where/when/what/how. So I also want to create a log for each profile, to record the progress each time the profile is run. No problems so far... except that I want the profile log to be stored alongside the profile itself, so this means I need to configure NLog

why TimedRotatingFileHandler does not delete old files?

青春壹個敷衍的年華 提交于 2020-01-14 14:12:46
问题 I am using TimedRotatingFileHandler to create my logs. I want my log files to be created every minute, keep at most 2 log files and delete older ones. Here is the sample code: import logging import logging.handlers import datetime logger = logging.getLogger('MyLogger') logger.setLevel(logging.DEBUG) handler = logging.handlers.TimedRotatingFileHandler( "logs/{:%H-%M}.log".format(datetime.datetime.now()), when="M", backupCount=2) logger.addHandler(handler) logger.debug("PLEASE DELETE PREVIOUS