Questions tagged [logging]

15243 questions
1

votes
2

answer
718

Views

How to set logging level in twisted?

I am using autobahn package with twisted which shows debug message for me every connect to websocket. I tried to switch logging level to info but had no success: import logging logging.basicConfig(level=logging.INFO) Is there an easy way to switch log level? Updated. Here is the twisted_service.py:...
kalombo
1

votes
1

answer
60

Views

Can you capture the name of the object that throws a NullReferenceException?

Is there a way to find out what specific object caused a NullReferenceException? I've read the page about troubleshooting NullReferenceExceptions and it talks about inspecting variables in the debugger and looking at the exception message. What if the exception was thrown in production code so you...
Lews Therin
1

votes
2

answer
78

Views

How to log only specific things to log file?

I'm working on web scraping where I should scrap multiple urls. I'm using ThreadPoolExecutor to do the task. I also want to implement logging in it. I want only specific debug or info or warning statements to be written to log files. But it is actually writing every request to log file. How do I ma...
Sukumar Rdjf
0

votes
0

answer
7

Views

Improving the relevance of production errors reporting

The support mailbox became unusable : In our mvc application, we catch exceptions thrown at several places (OnException implemented, try/catch in InvokeActionMethod, etc.) and we send a mail for each place (with a log4net appender). This results in an abundance of error mails in the common exchange...
Jean-Luc T.
1

votes
2

answer
1.9k

Views

Create lazy messages in log4j2

I have this code: import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Test { private static final Logger logger = LogManager.getLogger(); public static void main (String[] args) { logger.info('Text: {}', getText()); } static String getText() { // Expensiv...
Olivier Grégoire
1

votes
3

answer
1.2k

Views

How to create log file freshly every time I run my Java Program using Log4j?

Currently I am using log4j for logging. It is generating the log file perfectly.But the problem is: whenever I run my program new logs which are generated are getting appended to already generated logs in the same file. Below is my log4j properties file: log4j.rootCategory=INFO,LOGFILE log4j.logger....
Hema Chandra
0

votes
0

answer
5

Views

pm2 eats cluster logs when using child_process

I'm using PM2 v.3.2.2 I have a nodejs program composed of 2 script: main.js and child.js. main.js creates a child_process.fork of child.js. main.js and child.js print some logs using console.log. If I start the main.js script using pm2 start main.js everything works great, I can see both logs. If I...
Gappa
1

votes
3

answer
59

Views

Getting the object variable name for the new object

I have an object constructor such as: function myObjConstr () { console.log(object_name); } I want this results: var name1 = new myObjConstr(); //print in console log 'name1' var nameff = new myObjConstr(); //print in console log 'nameff'
Mostafa Maher
1

votes
3

answer
36

Views

How to write all logs of django console to to custome file file?

I just Started to try django logging module in my project... I am following django docs for loging all logs from Django’s default logging configuration to a custome log file. I copied the following code to my settings.py LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': {...
Jayesh Singh
1

votes
1

answer
39

Views

How to use levels from loglevel in std.experimental.logger?

At std.experimental.logger there are things like: logf(LogLevel.info, 5 < 6, '%s to the sharedLog with its LogLevel.info', 'Logging'); What is the 5 < 6 thing?
porton
1

votes
1

answer
47

Views

How to prevent string builder in log message if log level is disabled

When I have a log message in the code (say logger.debug('Some message {}', someFunction());) in situations where the log level is above debug, I've now built a string and called someFunction() for no reason. I'm used to C++ and there I would use some macro which would check the log level before actu...
Avi Poss
1

votes
2

answer
2.2k

Views

JUL to SLF4j with oracle jdbc driver

I am trying to redirect java.util.logging messages logged by the oracle jdbc driver and the oracle ucp (universal connection pool) library, but not able to do so. The messages logged by my application using JUL get logged but the ones logged by the oracle libraries are not getting logged. My intent...
Andy Dufresne
1

votes
2

answer
700

Views

Apache Camel redelivery: how to use the attempt number

I have a Camel Route with the onException clause: at each redelivery I want to increase the redeliveryDelay. How do I get the attemptNumber? The DefaultErrorHandler clearly stores it somewhere because it prints it in the log e.g. 'On delivery attempt: 1 caught' onException(MyException.class) .handle...
Gep
1

votes
1

answer
76

Views

boost::log 1.66.0. Argument for set_filter from boost's tutorial is wrong

I'm going thru boost::log library tutorial using Boost 1.66.0 and VS 2017. Get the problem in the very beginning: void init() { logging::core::get()->set_filter ( logging::trivial::severity >= logging::trivial::info ); } Error: No operator '>=' matches these operands ... It looks legitimate - Fir...
egor
1

votes
1

answer
512

Views

R sink(): Error, cannot split the message connection

I am trying to log the errors and warnings of an R script into an external file. At the same time I want to be able to see the errors and warnings in the console in RStudio (useful to develop and debug). I am trying to use the following code: logfile
user2348684
1

votes
0

answer
157

Views

kubernetes: Unable to get pod logs

I have set up a k8s cluster via Rancher UI on aws. I have deployed my app using several services and deployments. However, I am completely unable to get access to the pod/container logs. $ kubectl logs -f Unable to connect to the server: EOF What is more, when accessing the pod via the Kubernetes d...
pkaramol
1

votes
0

answer
20

Views

logger: DEBUG and INFO not logged (handler and level set)

I want to log DEBUG and INFO to stdout and the rest to stderr. I set up a filter and am creating a logger with two different handlers: import logging # https://stackoverflow.com/questions/16061641/ class InfoFilter(logging.Filter): '''Filter used to catch DEBUG and INFO for stdout_handler''' def fil...
Jimmy Sanchez
1

votes
1

answer
368

Views

what's the best way to filter passwords out of log files in a Koa app?

I'm working on a NodeJS app that is using KoaJS. By default, I see all the request data in the STDOUT log, which includes user's password when they register. I've used express middleware with options that filter out specific attributes in the past, and wondering what are good options to do this wit...
Ultrasaurus
1

votes
0

answer
32

Views

Do I need to rotate jornald?

I want to use journald as logging driver of docker. As I am not familiar with journald, I am worried that the logging file may exhaust the storage of the host. Do I need to rotate journald somehow? If so, how?
Yao Zhao
1

votes
0

answer
26

Views

Pandas - Writing a Change Log Between Multiple Dataframes

I am trying to think of the most efficient way to write a change log for large dataframes. I have thousands of dataframes that have one million rows and 20 column, so efficiency is paramount. I have a couple solutions for checking for differences between two dataframes, but I cannot figure out the...
Tyler Russell
1

votes
0

answer
59

Views

Timestamp in log changed cultureformat from 24h to 12h during runtime

I'm writing this question in the hope that you could lead me in the right direction regarding our current logging timestamp (on some servers). During a deployment session we noticed that the timestamp format changed from 24h to a 12h am/pm format. This change was not intervened by the deployment tho...
Rane Balslev
1

votes
0

answer
42

Views

Using Stroom to parse Snort log files

I've been working with Stroom for the past 2 days and have been trying to parse snort log files in this pattern 2017/10/17 11:30:02.43 172.16.0.1 334 172.16.0.100 25 I made a DSparser and coded this inside it When I start the feed and test if it is parsing anything I'm getting nothing. Any help woul...
Adil15
1

votes
0

answer
202

Views

How to store rest client logging in a variable in Spring Boot(logging)?

I am working on a rest client in Spring boot. And I have enabled logging in spring boot by putting the underlying lines in the property file. logging.level.org.apache.http=DEBUG logging.level.org.apache.http.wire=DEBUG After this I am getting the request sent as well as the response in the xml forma...
Anant666
1

votes
0

answer
35

Views

use Lib.cmd to give commands while logging to stdout

I'm fairly new to python. Now I wrote a python program that does A) background checks in one thread, and logs the result of it with logging to stdout. And B) also has a Lib.cmd running in a loop to give the program commands. import logging from cmd import Cmd class TPrompt(Cmd): def do_config(sel...
Aart
1

votes
1

answer
386

Views

Getting caller class name for Formatter [Java Logging with File Handler]

I want to add a FileHandler to my logger. And I am also creating a new Formatter(java.util.logging.Formatter) for my FileHandler In the format method https://docs.oracle.com/javase/7/docs/api/java/util/logging/Formatter.html#format(java.util.logging.LogRecord), is it possible to get the class which...
Ian Lim
1

votes
0

answer
86

Views

ILogger log.Error method could not log Dictionary<string,string> or custom class in AppInsights

loggerFactory.AddApplicationInsights(app.ApplicationServices); try { throw new Exception('This is a test exception for app insights.'); } catch (Exception ex) { logger.LogError(ex, 'Exception message',new Dictionary() { {'Controller','Error' } }); throw; } I want to log error with this args, where a...
Andrej
1

votes
1

answer
202

Views

Most of the log missing after using AsyncWrapper at NLog

I was using NLog synchronous logging that wrote all of my log messages but that took more time to execute. So, I looked forward to asynchronous log. But after implement async logging many logs are missing when per second log is more than 300. But my requirement is to write more than 2000 log in a se...
Rousonur Jaman
1

votes
0

answer
74

Views

Can we log per spring Integration flow?

Spring integration really helps us a lot during application integration, it make us more focus on flow design. However we have an requirement to have logs per integration flow, any suggestions how to achieve this? Currently we use for logging. in our case, each integration flow is one spring-contex...
Jackie Dong
1

votes
0

answer
60

Views

nginx/gunicorn log initial request on receive not after processing?

Both Nginx & gunicorn log requests AFTER they have processed them. Two questions, is the timestamp then related to when the response is finalised and sent back and if so is there a way to log initial request received time in either server log?
user1561108
1

votes
1

answer
372

Views

How to differentiate docker system logs from docker container logs?

Everything I saw about the docker daemon logs is that they can be found under journalctl -u docker in case of systemd presence. Recently my docker (v.1.13.1) containers hung up. sudo journalctl -u docker only gives me container logs that generated by my applications. I see no docker daemon output th...
4xy
1

votes
1

answer
400

Views

MySQL Login / Logout Audit

I need to know when users log in and log out to the mysql database. My first attempt was to set the parameters general_log and log_output = FILE. However these options generate excessive logs and this is a problem for me. In fact I do not need to know which queries were executed; just need to know w...
Thiago
1

votes
0

answer
88

Views

Django: Different level of logging on server and locally

I've set the logging level to INFO for loggers and handlers. Everything works as expected when I run Django on my local machine with ./manage.py runserver. However, on Apache server with WSGI, the log contains only WARNING logs. The DEBUG variable is set to True in both cases. Here is critical part...
Jiří Mauritz
1

votes
1

answer
131

Views

Write logs to Unix box in Spring Boot Application

I want to deploy my spring boot application to a unix server and write logs to a specific directory on the server. Right now, I am able to write logs to my a log file in my spring boot app but it is inside my project. So my project exists in Project/myApp and logs are written to Project/myApp/logs/m...
T. Phillips
1

votes
0

answer
65

Views

jest, logging success or failure between each test while the tests are running

seems like something quite basic but it dosen't seem to be available in jest automatically. when i run my jest tests, during the test run i get the logging info from the code itself while the tests are run. and only after the tests are finished i receive a summary of the spec results(which tests pas...
zeev_r
1

votes
0

answer
313

Views

How to dump the request and response headers between squid and upstream proxy?

I have squid web proxy setup on OpenWRT router. The proxy is configured to use upstream corporate proxy. I am wondering if there is a way to dump request/response headers for every outgoing request to cache peer.
PC Guy
1

votes
2

answer
2.8k

Views

spring boot application properties for logging

I've seen many examples of configuring logging in Spring Boot, but what I look for is the simplest way to get the job done modifying this pattern in my application.properties: logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n' logging.file=/Users/alessandroargenti...
Alex Mawashi
1

votes
0

answer
273

Views

How to disable logging in dmesg (/proc/kmsg) for specific device/driver?

I am using a TechnoTrend TT-connect S2-3600 which is known for spamming dmesg (respectively /proc/kmsg) with the following errors: [ 8360.122449] pctv452e: I2C error -121; AA A1 CC 00 01 -> 55 a1 31 03 cc 00 00 [ 8360.135079] pctv452e: I2C error -121; AA B8 CC 00 01 -> 55 b8 31 03 cc 00 00 [ 8360....
schmodd
1

votes
0

answer
278

Views

Python Fast/High Performance Logging

I am looking for a way to log events from a custom 'smart-device' with close to millisecond precision. The smart device is a custom board running on a TI-MSP430 chip, but I am sure that is irreverent. Here is an example of my current data, 2018:01:11:14:06:06.872957,x,x,x,x, 2018:01:11:14:06:07.384...
Tyler Fricks
1

votes
1

answer
69

Views

std::ofstream in global operator new

Is there a way to write to a file within a replaced global operator new? // simple operator new replacment void* operator new(std::size_t bytes) { std::ofstream log{'log.txt'}; log
A-n-t-h-o-n-y
1

votes
0

answer
87

Views

Rollbar and celery causing crash onrunning django project

I'm trying to debug a problematic error which occurs when I'm trying to launch django project in which I'm using (among others) celery and rollbar. The problem occurs when I change logging level for mail_admins from ERROR to WARNING. Complete traceback is below: (env)[email protected]:/var/www/papukurier_te...
gonczor

View additional questions