# Debugging Tools for QBCore

> Need an interactive debugger? Try our [Event Debugger](/tools/event-debugger) and [Config Validator](/tools/config-validator) for hands-on troubleshooting.

## Overview

Debugging a QBCore server involves monitoring server logs, tracing events, validating configuration files, and profiling resource performance. This page highlights built-in utilities and community tools that streamline the process.

## Essential Tools

###

### Event Debugger

    Capture client/server events in real time to see what scripts are firing and when.

### Config Validator

    Validate JSON, Lua, and YAML configs to catch typos before restarting your server.

### Code Generator

    Quickly scaffold boilerplate for new resources with consistent patterns and exports.

## Recommended Workflow

1. **Reproduce the Issue**: Collect exact steps and player identifiers.
2. **Check Console Logs**: Review both server logs and the F8 client console for errors or warnings.
3. **Trace Events**: Use the Event Debugger to capture the relevant triggers.
4. **Validate Configs**: Run configuration files through the validator to catch syntax issues.
5. **Inspect Database**: Ensure that tables and data exist for the resource you're debugging.
6. **Profile Performance**: Use the FiveM profiler (`profiler view`) to catch slow resource loops.

## Common Debugging Tasks

### Fixing Missing Items

- Verify the item exists in `qb-core/shared/items.lua`.
- Ensure the item image is placed in the correct inventory `html/images` directory.
- Restart the inventory resource and check for console errors.

### Tracking Event Spam

- Open the Event Debugger and set filters for the events you expect.
- If you see unexpected spam, locate the triggering script and add rate limiting.
- Use the FiveM `sv_eventLog` cvar to log to console for deeper analysis.

### Validating Configuration Changes

- Paste your configuration into the [Config Validator](/tools/config-validator).
- Fix warnings about duplicate keys or invalid JSON/Lua syntax.
- Commit changes to version control so you can roll back if needed.

## Tips

- Run your server with `+set onesync on` and watch for resource warnings when scaling player slots.
- Keep a staging server for testing major updates.
- Use Git branches or tags to track changes to configuration files and custom scripts.
- Enable debug logging in individual resources (`Config.Debug = true`) only while investigating issues.

## Further Reading

- [Server Optimization Guide](/docs/performance/server-optimization)
- [Performance Monitor tools](/resources/tools/performance)
- [QBCore Framework documentation](/docs)
