Coder Social home page Coder Social logo

Comments (8)

dereuromark avatar dereuromark commented on July 22, 2024

It is most likely because you didnt disable the scopes on the main ones:
http://sandbox.dereuromark.de/pages/best-practices#logging

from cakephp-databaselog.

thomasgatt avatar thomasgatt commented on July 22, 2024

Should I disable the scopes in the app.php file? I am following your setup code:

You can simply modify the existing config entries in your config/app.php:

'Log' => [
'debug' => [
'className' => 'DatabaseLog.Database'
],
'error' => [
'className' => 'DatabaseLog.Database'
],
],

from cakephp-databaselog.

dereuromark avatar dereuromark commented on July 22, 2024

try it. helped me.

from cakephp-databaselog.

thomasgatt avatar thomasgatt commented on July 22, 2024

I get a RunTime error - Could not load class debug.

But with the following code everything works perfectly

'Log' => [
		'debug' => [
			'className' => 'DatabaseLog.Database',
		],
	],

from cakephp-databaselog.

dereuromark avatar dereuromark commented on July 22, 2024

Maybe the example isnt clear, you should only add

'scopes' => false,

into it, not completely replace the config..

from cakephp-databaselog.

thomasgatt avatar thomasgatt commented on July 22, 2024

Yes of course. This produces duplicate logging:

	'Log' => [
		'debug' => [
			'className' => 'DatabaseLog.Database',
			'scopes' => false,
		],
		'error' => [
			'className' => 'DatabaseLog.Database',
			'scopes' => false,
		]
	],

If I add another log level, the log is written 3 times instead of twice. But if I leave only one log level (debug) for example, I get only one. Basically scopes => false doesn't seem to affect. Could be a bug that was fixed in versions > 3.3.16?

from cakephp-databaselog.

dereuromark avatar dereuromark commented on July 22, 2024

Of course, this is a more recent fix for sure, you should always be using the latest 3.x version, always.

from cakephp-databaselog.

thomasgatt avatar thomasgatt commented on July 22, 2024

I've looked at the updates and since this project will go live very soon I'm not keen of updating at this point. But will definitely update in the near future. Thank you for your help and service!

from cakephp-databaselog.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.