logging

How do I make a Makefile to log both command and its output to a file?

不羁岁月 提交于 2021-01-28 06:34:41
问题 I want to log both the command and its output to a log file. It seems easy. Just redirect stdout to the log file. myrule: mycommand >> logfile But this only logs the output of the command. Not the command itself. Do I also echo the command and redirect that output to the log file? myrule: @echo mycommand >> logile mycommand >> logfile This duplication of 'mycommand' doesn't look good and it takes up space in the recipe. Especially if the recipe is long. Should I create a function and call it

Sentry not capturing exceptions automatically in a spring boot application

荒凉一梦 提交于 2021-01-28 06:10:32
问题 I want to track exceptions of my spring boot application using sentry. Sentry is not capturing exceptions automatically. But when I use Sentry.capture(e); in catch block then Sentry is capturing error. Here are configurations and some code snippets. Thank you for your help in advance @SpringBootApplication @EnableAutoConfiguration public class MyApplication implements CommandLineRunner { private static final Logger logger = LoggerFactory.getLogger(MyApplication.class); public static void main

Python 2.7.2 doesn't properly iterate through logger's handlers

烈酒焚心 提交于 2021-01-28 06:04:17
问题 the following code is very simple, but for some reason, for-loop does not iterate through all handlers of the logger. however, for-loop does iterate through all handlers if we remove my_logger.removeHandler( handler ) in the else clause. any idea if I'm doing anything wrong? import logging import sys stdf = logging.Formatter( "%(message)s" ) filef = logging.Formatter( "%(message)s" ) my_logger = logging.getLogger( "file std logger" ) stdh = logging.StreamHandler( sys.stdout ) stdh

Python logger.debug converting arguments to string without logging

不打扰是莪最后的温柔 提交于 2021-01-28 05:05:17
问题 I'm optimizing a Python program that performs some sort of calculation. It uses NumPy quite extensively. The code is sprinkled with logger.debug calls (logger is the standard Python log object). When I run cProfile I see that Numpy's function that converts an array to string takes 50% of the execution time. This is surprising, since there is no handler that outputs messages as the DEBUG level, only INFO and above. Why is the logger converting its arguments to string even though nobody is

Suppress output from Codeship service

拟墨画扇 提交于 2021-01-28 04:46:14
问题 I'm testing a container in Codeship that requires a database. Using services in codeship-services.yml I'm linking the database container to the application container. The problem is the database container is printing a lot of output that gets mixed with the output of the tests. I want to get rid of the MongoDB logs completely but MongoDB doesn't have options to do that. I'm currently running it with mongod --quiet --setParameter logLevel=0 but getting a lot of output still. So I'm looking for

Kubernetes - net/http: TLS handshake timeout when fetching logs (BareMetal)

人走茶凉 提交于 2021-01-28 03:20:51
问题 I have checked all over Google and Stackoverflow for any kind of hint as to the cause of the issue, yet nothing that will help resolve it. Background: 1 Master 6 Nodes Master and 4 Nodes working fine when collecting logs. 2 Brand new nodes, same os, same certs, same network, same configs, logs do not work. Issue: kubectl logs pod-5c474fdf8-fk5zm -n deployment Error from server: Get https://ip-addr:10250/containerLogs/deployment/pod-5c474fdf8-fk5zm/pod: net/http: TLS handshake timeout From the

File handling in Python: being used by another process

江枫思渺然 提交于 2021-01-28 01:46:32
问题 Well i made this script that its supouse to logg some keystrokes for a while save them in a file and then erase the file if the user want to however when the script tryes to delete the file i get this error. Traceback (most recent call last):File "C:\Users\Tormentor\Desktop\S.D.A.K.L\pregunta.py", line 34, in os.remove(path2+"\"+name) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:'C:\Users\Public\myfile.txt' I made some research

Enable http header logging for envoy in istio

那年仲夏 提交于 2021-01-28 01:38:03
问题 I want to be able to capture (log) (at least some of) envoy 's HTTP headers on my istio service mesh. I have gone through envoy 's docs, and in the log levels' section, it does not mention any header-specific information. Currently, my istio-proxy log is like this (this is from a stern output): mysvc-69c46fbc75-d9v8j istio-proxy {"bytes_sent":"124","upstream_cluster":"inbound|80|http|mysvc.default.svc.cluster.local","downstream_remote_address":"10.11.11.1:0","authority":"some.url.com","path":

SQL-Server: Is there an equivalent of a trigger for general stored procedure execution

天大地大妈咪最大 提交于 2021-01-28 00:04:05
问题 Hope you can help. Is there a way to reliably detect when a stored proc is being run on SQL Server without altering the SP itself? Here's the requirement. We need to track users running reports from our enterprise data warehouse as the core product we use doesn't allow for this. Both core product reports and a slew of in-house ones we've added all return their data from individual stored procs. We don't have a practical way of altering the parts of the product webpages where reports are

Streaming data with ProtoBuf to log file with a header

徘徊边缘 提交于 2021-01-27 23:18:05
问题 I am trying to stream data to a log file on an SD card on a microcontroller that reads from some sensors and stores the value in the file. To serialize the data I will be using NanoPB, the protobuf implementation for C which is quite resource efficient. The log file has the following structure: It needs to write a short header composed of a GUID, and a firmware version. After the header, the stream of data should be continuous and it should log the fields from the sensors but not the header