Add storage to log item as well

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-02-13 22:49:44 +01:00
parent fa684c0ef0
commit a422a59f99
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 33 additions and 3 deletions

View File

@ -688,7 +688,17 @@ abstract class Common implements Storage, ILockingStorage {
$logger = $this->getLockLogger();
if ($logger) {
$typeString = ($type === ILockingProvider::LOCK_SHARED) ? 'shared' : 'exclusive';
$logger->info('acquire ' . $typeString . ' lock on ' . $path, ['app' => 'locking']);
$logger->info(
sprintf(
'acquire %s lock on "%s" on storage "%s"',
$typeString,
$path,
$this->getId()
),
[
'app' => 'locking',
]
);
}
try {
$provider->acquireLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);
@ -708,7 +718,17 @@ abstract class Common implements Storage, ILockingStorage {
$logger = $this->getLockLogger();
if ($logger) {
$typeString = ($type === ILockingProvider::LOCK_SHARED) ? 'shared' : 'exclusive';
$logger->info('release ' . $typeString . ' lock on ' . $path, ['app' => 'locking']);
$logger->info(
sprintf(
'release %s lock on "%s" on storage "%s"',
$typeString,
$path,
$this->getId()
),
[
'app' => 'locking',
]
);
}
try {
$provider->releaseLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);
@ -728,7 +748,17 @@ abstract class Common implements Storage, ILockingStorage {
$logger = $this->getLockLogger();
if ($logger) {
$typeString = ($type === ILockingProvider::LOCK_SHARED) ? 'shared' : 'exclusive';
$logger->info('change lock on ' . $path . ' to ' . $typeString, ['app' => 'locking']);
$logger->info(
sprintf(
'change lock on "%s" to %s on storage "%s"',
$path,
$typeString,
$this->getId()
),
[
'app' => 'locking',
]
);
}
try {
$provider->changeLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);