refactor: improve logging system and add deployment fixes
- Enhance logging handlers (Console, DockerJson, File, JsonFile, MultiFile) - Improve exception and line formatters - Update logger initialization and processor management - Add Ansible playbooks for staging 502 error troubleshooting - Update deployment documentation - Fix serializer and queue components - Update error kernel and queued log handler
This commit is contained in:
@@ -36,13 +36,14 @@ final readonly class PhpSerializer implements Serializer
|
||||
{
|
||||
// Check for resources in the data
|
||||
if ($this->containsResource($data)) {
|
||||
throw new SerializeException('Failed to serialize data: Resources cannot be serialized');
|
||||
throw SerializeException::simple('Failed to serialize data: Resources cannot be serialized');
|
||||
}
|
||||
|
||||
try {
|
||||
return serialize($data);
|
||||
} catch (\Exception $e) {
|
||||
throw new SerializeException('Failed to serialize data: ' . $e->getMessage(), 0, $e);
|
||||
|
||||
throw SerializeException::simple('Failed to serialize data: ' . $e->getMessage(), $e, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +114,7 @@ final readonly class PhpSerializer implements Serializer
|
||||
// Special case: if unserialize returns false, we need to check if the original data
|
||||
// was actually serialized false, or if there was an error
|
||||
if ($result === false && $data !== serialize(false)) {
|
||||
throw new DeserializeException('Failed to unserialize data');
|
||||
throw DeserializeException::simple('Failed to unserialize data');
|
||||
}
|
||||
|
||||
restore_error_handler();
|
||||
@@ -122,7 +123,7 @@ final readonly class PhpSerializer implements Serializer
|
||||
} catch (\Throwable $e) {
|
||||
restore_error_handler();
|
||||
|
||||
throw new DeserializeException('Failed to unserialize data: ' . $e->getMessage(), 0, $e);
|
||||
throw DeserializeException::simple('Failed to unserialize data: ' . $e->getMessage(), $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user