logging

How to set NLog max file size?

狂风中的少年 提交于 2020-08-24 06:43:06
问题 Is there any option/configuration in NLog to set the max log file size (for example 5MB)? What I need is, that when the log file exceeds the max size (which I define), It will backup the old one (with a time stamp as file name), and start writing to a new one. How can this be done? I would prefer some kind of build-in configuration, but if there is none can this be done safely manually without corrupting the log file? 回答1: You can set archiveNumbering="DateAndSequence" and archiveAboveSize=

Logging not working in laravel queue job

廉价感情. 提交于 2020-08-21 03:10:51
问题 I have the below settings in my supervisor/conf.d/myconf.conf file : [program:my-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html/artisan queue:work sqs --queue=my_queue_name --tries=3 --daemon autostart=true autorestart=true user=root numprocs=1 redirect_stderr=true stdout_logfile=/var/www/html/storage/logs/mylogfile.log I have give all permissions to storage/logs/mylogfile.log file. Not able to figure out why is it still not logging, 回答1: I guess you are

Logging not working in laravel queue job

两盒软妹~` 提交于 2020-08-21 03:02:48
问题 I have the below settings in my supervisor/conf.d/myconf.conf file : [program:my-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html/artisan queue:work sqs --queue=my_queue_name --tries=3 --daemon autostart=true autorestart=true user=root numprocs=1 redirect_stderr=true stdout_logfile=/var/www/html/storage/logs/mylogfile.log I have give all permissions to storage/logs/mylogfile.log file. Not able to figure out why is it still not logging, 回答1: I guess you are

Logging not working in laravel queue job

情到浓时终转凉″ 提交于 2020-08-21 03:02:24
问题 I have the below settings in my supervisor/conf.d/myconf.conf file : [program:my-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html/artisan queue:work sqs --queue=my_queue_name --tries=3 --daemon autostart=true autorestart=true user=root numprocs=1 redirect_stderr=true stdout_logfile=/var/www/html/storage/logs/mylogfile.log I have give all permissions to storage/logs/mylogfile.log file. Not able to figure out why is it still not logging, 回答1: I guess you are

Multiple Serilog Loggers

自作多情 提交于 2020-08-09 08:17:29
问题 Is it possible to have multiple serilog loggers? Currently within my WebApi I can call Log.Information for example to log an information event, but is there a way that I can instead make different logs and call ExternalLog.Information or AuthenticationLog.Information from my controller? The purpose behind this is that my web api is currently working with multiple different databases for different yet interrelated projects, and I would like to store logs within each of these databases that