Skip to content

Commit 95113a9

Browse files
committed
Move internal PDF log to application logs
1 parent a7063ca commit 95113a9

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

Packages/Application/Sfi.Umo/Classes/Controller/BackendController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ protected function getInternalSignedPdfsBasePath(): string
229229

230230
protected function getInternalSignedPdfsLogPath(): string
231231
{
232-
return $this->getInternalSignedPdfsBasePath() . '/generation.log';
232+
return rtrim(FLOW_PATH_DATA, '/') . '/Logs/InternalSignedPdfs/generation.log';
233233
}
234234

235235
protected function appendInternalSignedPdfsLog(string $message): bool
@@ -239,8 +239,8 @@ protected function appendInternalSignedPdfsLog(string $message): bool
239239
return true;
240240
}
241241

242-
$basePath = $this->getInternalSignedPdfsBasePath();
243-
if (!is_dir($basePath) && !@mkdir($basePath, 0775, true) && !is_dir($basePath)) {
242+
$logDirectory = dirname($this->getInternalSignedPdfsLogPath());
243+
if (!is_dir($logDirectory) && !@mkdir($logDirectory, 0775, true) && !is_dir($logDirectory)) {
244244
return false;
245245
}
246246

Packages/Application/Sfi.Umo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ PDF-файлы должны лежать прямо в той же папке,
5858

5959
Внизу страницы модуля показывается путь к рабочей папке, путь к логу и последние строки лога. После запуска генерации можно нажимать `Обновить лог`, чтобы увидеть текущий результат.
6060

61-
Лог записывается в файл:
61+
Лог записывается в файл в папке логов приложения:
6262

6363
```text
64-
/data/www-provisioned/Web/umo/internal/generation.log
64+
Data/Logs/InternalSignedPdfs/generation.log
6565
```
6666

6767
## Что появится в результате

Packages/Sites/Sfi.Sfi/Classes/Sfi/Sfi/Command/SignatureCommandController.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ public function generateSignedPdfsCommand(bool $force = false, bool $dryRun = fa
181181
public function generateInternalSignedPdfsCommand(bool $force = false, bool $dryRun = false): void
182182
{
183183
$internalBasePath = rtrim(FLOW_PATH_WEB, '/') . '/umo/internal';
184-
$logFile = $internalBasePath . '/generation.log';
184+
$logFile = $this->getInternalSignedPdfsLogPath();
185185

186186
if (!is_dir($internalBasePath)) {
187-
$this->outputLine('Internal UMO folder does not exist: %s', [$internalBasePath]);
187+
$this->log($logFile, $dryRun, 'Internal UMO folder does not exist: %s', [$internalBasePath]);
188188
return;
189189
}
190190

@@ -486,6 +486,11 @@ protected function readInternalIndexCsv(string $indexPath): ?array
486486
];
487487
}
488488

489+
protected function getInternalSignedPdfsLogPath(): string
490+
{
491+
return rtrim(FLOW_PATH_DATA, '/') . '/Logs/InternalSignedPdfs/generation.log';
492+
}
493+
489494
/**
490495
* Collect items from Sfi.Shared:Asset nodes with signee property set
491496
*/

0 commit comments

Comments
 (0)