Compare commits
No commits in common. "master" and "2.0.5" have entirely different histories.
5 changed files with 6 additions and 25 deletions
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -5,23 +5,6 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.0.7] - 2025-01-13
|
||||
|
||||
This update introduces a minor fix
|
||||
|
||||
### Fixed
|
||||
- Fixed FileLogging issue by setting the write permission to 0666 for the log file if it doesn't exist.
|
||||
|
||||
|
||||
|
||||
## [2.0.6] - 2025-01-10
|
||||
|
||||
This update introduces a minor change
|
||||
|
||||
### Changed
|
||||
- File logging is disabled for web environments due to instability in file locking, until a better solution is found.
|
||||
|
||||
|
||||
## [2.0.5] - 2025-01-09
|
||||
|
||||
This update introduces a minor bug fix
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"package": "net.nosial.loglib",
|
||||
"company": "Nosial",
|
||||
"copyright": "Copyright (c) 2022-2023 Nosial",
|
||||
"version": "2.0.7",
|
||||
"version": "2.0.5",
|
||||
"uuid": "de1deca6-7b65-11ed-a8b0-a172264634d8"
|
||||
},
|
||||
"build": {
|
||||
|
|
|
@ -32,11 +32,8 @@
|
|||
// Create the file if it doesn't exist
|
||||
if (!file_exists($filePath))
|
||||
{
|
||||
// Create the file
|
||||
touch($filePath);
|
||||
|
||||
// Set the file permissions to 0666
|
||||
chmod($filePath, 0666);
|
||||
$this->fileHandle = fopen($filePath, 'w');
|
||||
fclose($this->fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ class ConsoleLogging implements LogHandlerInterface
|
|||
*/
|
||||
public static function handle(Application $application, Event $event): void
|
||||
{
|
||||
// Check if the application is running in a CLI environment, if not, return
|
||||
if(!Utilities::runningInCli())
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -88,9 +88,9 @@ class FileLogging implements LogHandlerInterface
|
|||
|
||||
$logging_file = $logging_directory . DIRECTORY_SEPARATOR . Utilities::sanitizeFileName($application->getApplicationName()) . '-' . date('Y-m-d') . '.log';
|
||||
|
||||
if(!file_exists($logging_file) && !@touch($logging_file))
|
||||
if(!file_exists($logging_file))
|
||||
{
|
||||
throw new RuntimeException(sprintf("Cannot write to %s due to insufficient permissions", $logging_file));
|
||||
touch($logging_file);
|
||||
}
|
||||
|
||||
return $logging_file;
|
||||
|
|
Loading…
Add table
Reference in a new issue