Project

General

Profile

Actions

Bug #51507

closed

Use logging framework in DatabaseConnection

Added by Sascha Egerer over 10 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Start date:
2013-08-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

Currently the logging in DatabaseConnection is not really clean and complete.

DatabaseConnection should use the logging framework to log executed Queries and SQL errors.

Actions #1

Updated by Philipp Gampe over 10 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (6.2.0)
  • Complexity set to medium

A good idea and a nice and isolated way to start the integration of the logging framework.

Can you create a first patch and upload it to gerrit? http://wiki.typo3.org/CWT

Actions #2

Updated by Sascha Egerer over 10 years ago

I'm working on it...

Actions #3

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #4

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #5

Updated by Gerrit Code Review over 10 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #6

Updated by Gerrit Code Review over 10 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #7

Updated by Gerrit Code Review over 10 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #8

Updated by Gerrit Code Review over 10 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #9

Updated by Gerrit Code Review over 10 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #10

Updated by Gerrit Code Review over 10 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #11

Updated by Gerrit Code Review over 10 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #12

Updated by Gerrit Code Review over 10 years ago

Patch set 10 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #13

Updated by Gerrit Code Review over 10 years ago

Patch set 11 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #14

Updated by Gerrit Code Review over 10 years ago

Patch set 12 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #15

Updated by Gerrit Code Review over 10 years ago

Patch set 13 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #16

Updated by Gerrit Code Review over 10 years ago

Patch set 14 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #17

Updated by Gerrit Code Review over 10 years ago

Patch set 15 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #18

Updated by Gerrit Code Review almost 10 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #19

Updated by Gerrit Code Review almost 10 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #20

Updated by Sascha Egerer almost 10 years ago

  • Is Regression set to No

Example logging framework configuration.

Put this into you AdditionalConfiguration.php. But do this never ever on any production system!

$GLOBALS['TYPO3_CONF_VARS']['LOG']['TYPO3']['CMS']['Core']['Database'] = array(
    'writerConfiguration' => array(
        \TYPO3\CMS\Core\Log\LogLevel::DEBUG => array(
            'TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => array(
                // configuration for the writer
                'logFile' => 'typo3temp/logs/databaseQueries.log'
            )
        ),
    )
);

Actions #21

Updated by Gerrit Code Review almost 10 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #22

Updated by Gerrit Code Review almost 10 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #23

Updated by Gerrit Code Review almost 10 years ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23462

Actions #24

Updated by Gerrit Code Review almost 10 years ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #25

Updated by Gerrit Code Review almost 10 years ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #26

Updated by Gerrit Code Review over 9 years ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #27

Updated by Gerrit Code Review over 9 years ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #28

Updated by Gerrit Code Review over 9 years ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #29

Updated by Gerrit Code Review over 9 years ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #30

Updated by Gerrit Code Review over 9 years ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #31

Updated by Gerrit Code Review over 9 years ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #32

Updated by Gerrit Code Review about 9 years ago

Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #33

Updated by Gerrit Code Review almost 9 years ago

Patch set 30 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/23462

Actions #34

Updated by Christian Kuhn over 8 years ago

  • Status changed from Under Review to On Hold

patch abandoned, solution "on hold" until logging decisions have been taken.

Actions #35

Updated by Benni Mack over 6 years ago

  • Status changed from On Hold to Accepted
  • Target version set to 9 LTS

Now that we streamlined logging in most places in the core, Logging could be added to Doctrine DBAL

Actions #36

Updated by Susanne Moog over 5 years ago

  • Target version changed from 9 LTS to Candidate for patchlevel
Actions #37

Updated by Susanne Moog about 4 years ago

  • Status changed from Accepted to Closed

Fortunately, adding logging to doctrine is not our job and has in fact been done for us by the doctrine people. It's what the admin panel already uses to display all SQL queries.

Basically, if you need it (mind the performance impact):

            $connection = $this->connectionPool->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME);
            $connection->getConfiguration()->setSQLLogger(GeneralUtility::makeInstance(SQLLogger::class));
Actions

Also available in: Atom PDF