# How to configure cron with debug logging

## Environment

Red Hat Enterprise Linux

## Issue

How can `cron` be configured to run in debug mode for more detailed logging?

## Resolution

The crond daemon has an `-x` option to set the following debug flags:

```
crond -x [ext,sch,proc,pars,load,misc,test,bit]

ext   print extended debugging information
sch   scheduling
proc  process control
pars  parsing
load  database loading
misc  miscellaneous
test  test mode - do not actually execute any commands
bit   show how various bits are set (long)
```

**Add** the following line to the `/etc/sysconfig/crond` file to enable debugging:

`CRONDARGS="-x ext,sch,proc,pars,load,misc,bit"`

**Restart** the `crond` daemon:

***

**Red Hat Enterprise Linux 6**\
`$ sudo service crond restart`

**Red Hat Enterprise Linux 7 or later**\
`$ sudo systemctl restart crond`

***

Additional log entries for `cron` will be in the `/var/log/messages` file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorials.garnerpcsquad.com/readme/how-to-configure-cron-with-debug-logging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
