logging

HBase Shell Logging

白昼怎懂夜的黑 提交于 2020-06-27 08:22:09
问题 When using the HBase shell, I'm getting a great deal of logging, including INFO and DEBUG messages. While this is interesting in terms of learning HBase internals, it is quite verbose and can bury the output. I've tried changing the logging levels in a number of different ways, including as described here, and while some of the warnings do disappear, I continue to get a large number of INFO and DEBUG messages, i.e.: 18:50:49.500 [main] INFO org.apache.zookeeper.ZooKeeper - Client environment

Why does .NET Core DI container not inject ILogger?

烂漫一生 提交于 2020-06-27 07:20:07
问题 I am trying to get logging up and running in my C# console app based on .NET Core 2.1. I added the following code to my DI declaration: var sc = new ServiceCollection(); sc.AddLogging(builder => { builder.AddFilter("Microsoft", LogLevel.Warning); builder.AddFilter("System", LogLevel.Warning); builder.AddFilter("Program", LogLevel.Warning); builder.AddConsole(); builder.AddEventLog(); }); I am trying to inject the service by using the Interface Microsoft.Extensions.Logging.ILogger in the

Log rotation on logs consuming disk space in Google Cloud Kubernetes pod

别说谁变了你拦得住时间么 提交于 2020-06-25 18:08:57
问题 We have a pod in a Google Cloud Platform Kubernetes cluster writing JsonFormatted to StdOut. This is picked up by Stackdriver out of box. However, we see the disk usage of the pod just growing and growing, and we can't understand how to set a max size on the Deployment for log rotation. Documentation on Google Cloud and Kubernetes is unclear on this. This is just the last hour: 回答1: Are you sure that disk usage of the pod is high because of the logs? If the application writes logs to stdout,

Log rotation on logs consuming disk space in Google Cloud Kubernetes pod

拥有回忆 提交于 2020-06-25 18:08:41
问题 We have a pod in a Google Cloud Platform Kubernetes cluster writing JsonFormatted to StdOut. This is picked up by Stackdriver out of box. However, we see the disk usage of the pod just growing and growing, and we can't understand how to set a max size on the Deployment for log rotation. Documentation on Google Cloud and Kubernetes is unclear on this. This is just the last hour: 回答1: Are you sure that disk usage of the pod is high because of the logs? If the application writes logs to stdout,

Laravel log file based on date

允我心安 提交于 2020-06-25 09:13:42
问题 By default laravel saves the log file to a single log file called laravel.log located in /storage/logs/laravel.log my question is how can i get a new log file everyday and store the log files like /storage/logs/laravel-2016-02-23.log for the current date, so i need everyday a new log file saved to /storage/logs/ i think we can do that by extending the default Illuminate\Foundation\Bootstrap\ConfigureLogging bootstraper class but i'm not sure how i can do that i would really appreciate it if

Laravel log file based on date

拈花ヽ惹草 提交于 2020-06-25 09:13:15
问题 By default laravel saves the log file to a single log file called laravel.log located in /storage/logs/laravel.log my question is how can i get a new log file everyday and store the log files like /storage/logs/laravel-2016-02-23.log for the current date, so i need everyday a new log file saved to /storage/logs/ i think we can do that by extending the default Illuminate\Foundation\Bootstrap\ConfigureLogging bootstraper class but i'm not sure how i can do that i would really appreciate it if

Use Flask current_app.logger inside threading

不问归期 提交于 2020-06-24 11:37:29
问题 I am using current_app.logger and when I tried to log inside thread it says "working outside of application context". How do I log a message from a method running in a thread? def background(): current_app.logger.debug('logged from thread') @app.route('/') def index(): Thread(target=background).start() return 'Hello, World!' Exception in thread Thread-16: Traceback (most recent call last): File "/usr/lib64/python3.5/threading.py", line 914, in _bootstrap_inner self.run() File "/usr/lib64

Using functools.wraps with a logging decorator

谁说我不能喝 提交于 2020-06-24 08:09:02
问题 I'm trying to write a simple decorator that logs a given statement before calling the decorated function. The logged statements should both appear to come from the same function, which I thought was the purpose of functools.wraps(). Why does the following code: import logging logging.basicConfig( level=logging.DEBUG, format='%(funcName)20s - %(message)s') from functools import wraps def log_and_call(statement): def decorator(func): @wraps(func) def wrapper(*args, **kwargs): logging.info

Using functools.wraps with a logging decorator

不羁岁月 提交于 2020-06-24 08:08:40
问题 I'm trying to write a simple decorator that logs a given statement before calling the decorated function. The logged statements should both appear to come from the same function, which I thought was the purpose of functools.wraps(). Why does the following code: import logging logging.basicConfig( level=logging.DEBUG, format='%(funcName)20s - %(message)s') from functools import wraps def log_and_call(statement): def decorator(func): @wraps(func) def wrapper(*args, **kwargs): logging.info

How to setup configuration in .NET Framework for Serilog

女生的网名这么多〃 提交于 2020-06-23 08:53:21
问题 Our team just moved one of our ASP.NET solutions from logging in log4net to Serilog (using iLogger) for logging. Our solution is .NET Framework 4.6. I can see Serilog configuration documentation online for setting up configuration in code as well as some documentation in appsettings.json. We have Web.config configuration files. Our old log4net configuration resided completely in the csproj files. Is there a place for configuration for Serilog and its sinks in .NET Framework (specifically in