Compare commits

..

No commits in common. "master" and "2.0.6" have entirely different histories.

4 changed files with 9 additions and 15 deletions

View file

@ -5,15 +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/), 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). 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 ## [2.0.6] - 2025-01-10
This update introduces a minor change This update introduces a minor change

View file

@ -20,7 +20,7 @@
"package": "net.nosial.loglib", "package": "net.nosial.loglib",
"company": "Nosial", "company": "Nosial",
"copyright": "Copyright (c) 2022-2023 Nosial", "copyright": "Copyright (c) 2022-2023 Nosial",
"version": "2.0.7", "version": "2.0.6",
"uuid": "de1deca6-7b65-11ed-a8b0-a172264634d8" "uuid": "de1deca6-7b65-11ed-a8b0-a172264634d8"
}, },
"build": { "build": {

View file

@ -32,11 +32,8 @@
// Create the file if it doesn't exist // Create the file if it doesn't exist
if (!file_exists($filePath)) if (!file_exists($filePath))
{ {
// Create the file $this->fileHandle = fopen($filePath, 'w');
touch($filePath); fclose($this->fileHandle);
// Set the file permissions to 0666
chmod($filePath, 0666);
} }
} }

View file

@ -21,6 +21,12 @@ class FileLogging implements LogHandlerInterface
*/ */
public static function handle(Application $application, Event $event): void public static function handle(Application $application, Event $event): void
{ {
// If we're running in a Web environment, return
if(!Utilities::runningInCli())
{
return;
}
if(!Validate::checkLevelType($event->getLevel(), $application->getFileLoggingLevel())) if(!Validate::checkLevelType($event->getLevel(), $application->getFileLoggingLevel()))
{ {
return; return;