exilon / QuickLogger

Powerful and flexible library for logging on files, console, memory, email, rest, eventlog, syslog, slack, telegram, redis, logstash, elasticsearch, influxdb, graylog, Sentry, Twilio, ide debug messages and throw events for Delphi/Firemonkey/freepascal/.NET (Windows/Linux/OSX/IOS/Android).
Apache License 2.0
381 stars 84 forks source link

Linux 使用守护进程 本地日志不能写入 #73

Closed yangleijing closed 1 year ago

yangleijing commented 2 years ago

if fork()<>0 then begin exit; end;

Logger.CustomTags['MYTAG2'] := FormatDateTime('YYYYMMDD', Now); // Logger.Providers.Add(GlobalLogFileProvider); with GlobalLogFileProvider do begin FileName := './log/'+aLogName+FormatDateTime('YYYYMMDD', Now)+'.log'; LogLevel := LOG_TRACE; TimePrecission := True; MaxRotateFiles := 10; MaxFileSizeInMB := 10; DailyRotate:= True; RotatedFilesPath := './log/Logs'; CompressRotatedFiles := False; // CustomMsgOutput := True; AppName:= 'TaskJob'; CustomFormatOutput := '[%{DATETIME}] [%{LEVEL}] : %{MESSAGE} [%{APPNAME}] [(%{MYTAG2})]'; CustomMsgOutput:= True; Enabled := True; end; //

不能写入本地日志, no find loginfo

exilon commented 2 years ago

Do you mean no log file was created after run process?

yangleijing commented 2 years ago

The log path has been created, but the log content has not been written. The log only writes the header file content when it is created

------------------ 原始邮件 ------------------ 发件人: "exilon/QuickLogger" @.>; 发送时间: 2022年6月15日(星期三) 凌晨3:43 @.>; @.**@.>; 主题: Re: [exilon/QuickLogger] Linux 使用守护进程 本地日志不能写入 (Issue #73)

Do you mean no log file was created after run process?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

exilon commented 2 years ago

Only occurs when you fork?

yangleijing commented 2 years ago

  Yes, as long as the daemon is not used and it works normally in other ways, you can test it

------------------ 原始邮件 ------------------ 发件人: "exilon/QuickLogger" @.>; 发送时间: 2022年6月16日(星期四) 凌晨4:21 @.>; @.**@.>; 主题: Re: [exilon/QuickLogger] Linux 使用守护进程 本地日志不能写入 (Issue #73)

Only occurs when you fork?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

exilon commented 2 years ago

Try to provide an absolute path log file.

exilon commented 1 year ago

Closing this issue as it has been inactive for an extended period of time and there has been no recent activity. If this issue is still relevant, please feel free to reopen it with updated information.