Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Some log files only keep 1 record in the file #1018

Closed eSilverStrike closed 4 years ago

eSilverStrike commented 4 years ago

All log files except the error.log file seems to only contain 1 record which gets overwritten when ever a new record gets added.

The error.log does add it's records to the end of the file when COM_errorLog is used, so it looks like something is happening in the log class.

eSilverStrike commented 4 years ago

@mystralkk I also notice that the new downsload.log file doesn't contain a time stamp anymore since the switch to its own log file.

How do you want to handle this? It would be nice for plugins (and easier to read) to use the same formats available to the core plugins but I notice each plugin is hardcoded into the class. Should we add a flag to the common function that would automatically add the

timestamp and/or remote ip and/or username

to the beginning of the log entry if set?

mystralkk commented 4 years ago

As for timestamp, I would change so that Log::callStatic() will automatically prepend it onto log entries. As for remote IP, username and user ID, I would change so that Log::callStatic() will accept as an element of its second argument (array) like Log::downloads($entry, 'rin'), 'r' for remote IP address, 'i' for user ID, and 'n' for user name respectively. If the second argument is omitted, then we assume 'rin' is specified. What do you think of this?

eSilverStrike commented 4 years ago

Sounds good.

mystralkk commented 4 years ago

Fixed with change set b2d8957.