Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Proper syntax for custom log file location?

Status Resolved
Add-on / Version DataGrab 421
Severity
EE Version 726

Paul Larson

Jan 17, 2023

Brian,

DG is writing to the default system/user/cache log just fine:

-bash-4.2$ cat system/user/cache/DataGrab-import.log 
21:34:31 01/17/2023 Import #58 Started
21:34:31 01/17/2023 Import #58 Initialized
21:34:31 01/17/2023 Begin Importing [1499SKEECH|EBONY]
21:34:31 01/17/2023 [1499SKEECH|EBONY] already exists. Updating.
21:34:32 01/17/2023 Calling after_channel_entry_save() hook.
21:34:32 01/17/2023 Updated 1 entries
21:34:32 01/17/2023 Begin Importing [1499SKEECH|JACOBEAN/BROWN]
21:34:32 01/17/2023 [1499SKEECH|JACOBEAN/BROWN] already exists. Updating.
21:34:33 01/17/2023 Calling after_channel_entry_save() hook.
21:34:33 01/17/2023 Updated 2 entries

But it’s not writing to my custom location.

Am I confusing DG with my settings?

// datagrab
$config['datagrab_log_type'] = 'file';
$config['datagrab_log_file'] = '/var/www/vhosts/example.com/httpdocs/cp_imports/sync-log/datagrab.log';

(File is 777)

#1

BoldMinded (Brian)

Because apparently I never actually implemented datagrab_log_file…. Oops.

#2

BoldMinded (Brian)

On line 117 of datagrab_model.php you’ll see this:

$this->logger = new Logger(
            ee()->logger,
            $this->config->item('datagrab_log_type'),
            sprintf('%sDataGrab-import.log', PATH_CACHE)
        );

Change it to this

$this->logger = new Logger(
            ee()->logger,
            $this->config->item('datagrab_log_type'),
            $this->config->item('datagrab_log_file') ?: sprintf('%sDataGrab-import.log', PATH_CACHE)
        );
#3

BoldMinded (Brian)

I’m gonna close this out b/c that code change should fix it and this will be included in the next release.

#4

Paul Larson

Comment has been marked private.

#5

BoldMinded (Brian)

It’s mean to refresh itself every import. It’s not a true persistent log file, it just tracks the progress of each import.

Login to reply