Remove JSON trace information

How can I disable or remove the trace information from the json response?

Could you give a example of what are you trying to do?

1 Like

Whenever I simulate an error it always return a trace/debug log. I think it is there for debugging but I don’t want it to show on production.

i.e. registering an existing user.

someField{},
trace { blah…}

Hello, I did some testing, and arrived at a possible solution.

In .env file (located in htdocs) there are two settings in the beginning of the file:

## ---------------------------------------
## Application Settings
## ---------------------------------------

APP_ENV = local
APP_DEBUG = false

I realized that if APP_ENV is different from “local”, ie “production” the trace is not entered in error JSON.

## ---------------------------------------
## Application Settings
## ---------------------------------------

APP_ENV = production
APP_DEBUG = false

Note: After changed to “production” did some testing, and only thing that changed was the addition of trace in the error messages. If something else changes, let you know.

4 Likes

It started to me also - After I flushed my cache and reloaded the .env file in htdocs -

VINEETs-MacBook-Pro:htdocs Vineet$ php artisan config:clear
Configuration cache cleared!

1 Like

The only change I did was added the Node.js support -

DF_NODEJS_PATH=/usr/local/bin/node

1 Like

thanks :slight_smile:

1 Like