Skip to content

Commit

Permalink
Log exceptions to nosto-exception.log file
Browse files Browse the repository at this point in the history
  • Loading branch information
supercid committed Jun 13, 2024
1 parent 6f0dbf2 commit 9a01f93
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This projec
### 7.6.0
* Deprecate MySQL as message queue provider, the extension now uses RabbitMQ as the default message queue provider
* Add command to clear the Nosto message queue
* Move Nosto logfiles to its own files nosto-debug.log(debug) and nosto-system.log(info)

### 7.5.1
* Upgrade SDK to 7.4
Expand Down
46 changes: 46 additions & 0 deletions Logger/ExceptionHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Copyright (c) 2020, Nosto Solutions Ltd
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @author Nosto Solutions Ltd <[email protected]>
* @copyright 2020 Nosto Solutions Ltd
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause
*
*/

namespace Nosto\Tagging\Logger;

use Magento\Framework\Logger\Handler\Base;
use Monolog\Logger;

class ExceptionHandler extends Base
{
protected $fileName = '/var/log/nosto-exception.log';
protected $loggerType = Logger::INFO;
}
1 change: 1 addition & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<argument name="handlers" xsi:type="array">
<item name="system" xsi:type="object">Nosto\Tagging\Logger\SystemHandler</item>
<item name="debug" xsi:type="object">Nosto\Tagging\Logger\DebugHandler</item>
<item name="exception" xsi:type="object">Nosto\Tagging\Logger\ExceptionHandler</item>
</argument>
</arguments>
</type>
Expand Down

0 comments on commit 9a01f93

Please sign in to comment.