Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ProcessMaker/Multitenancy/SwitchTenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\DB;
use Monolog\Handler\RotatingFileHandler;
use ProcessMaker\Multitenancy\Broadcasting\TenantAwareBroadcastManager;
use ProcessMaker\Multitenancy\TenantAwareDispatcher;
use Spatie\Multitenancy\Concerns\UsesMultitenancyConfig;
Expand Down Expand Up @@ -104,6 +105,15 @@ public function makeCurrent(IsTenant $tenant): void

config($newConfig);

// Put tenant logs in their own files
$app->make('log')
->driver('daily')
->getHandlers()[0]
->setFileNameFormat(
'{filename}-tenant_' . $tenant->id . '-{date}',
RotatingFileHandler::FILE_PER_DAY
);

// Set config from the entry in the tenants table
$config = $tenant->config;
if (isset($config['app.key'])) {
Expand Down
Loading