# Logging Category

Configure which log categories will show up in the logging. This helps to:

- Fine tune which category of logging shows up in the console
- Prevent too much noise in the logs

## How To

Set logging category via:

Way | Description
--- | ---
Query Parms | For any page using `TOP`
Log API | Requires set up on the page

### Query Params

`toplogcat` sets which log categories will show up in the console.

Multiple categories can be set by delimiting with a pipe character:

- http://.....html?toplogenabled=true&toplogcat=config|ads

### Log API

Log.updateCategories sets which log categories will show up in the console.

    var Log = TOP.logging.Log;
    Log.updateCategories({
        ads    : true,
        config : true
    });

## Categories

Check out Log.data to see what log categories are available / enabled:

    TOP.logging.Log.data().categories

will show something like the following:

    {
        ads                         : false
        ads.consumer                : false
        ads.provider                : false
        analytics                   : false
        api                         : false
        api.commands                : false
        api.events                  : false
        captions                    : false
        cms                         : false
        config                      : false
        core.controller.events.ads  : false
        core.controller.events.media: false
        core.notifications          : false
        cues                        : false
        fragment                    : false
        lib.tasks                   : false
        lib.timeline                : false
        manifest                    : false
        media                       : false
        mediaEngine                 : false
        mediaMetadata               : false
        persistence                 : false
        transaction                 : false
        ui                          : false
        ui.ads                      : false
        ui.api                      : false
        ui.cc                       : false
        ui.config                   : false
        ui.media                    : false
        ui.menus                    : false
        ui.slates                   : false
    }

### Sub-Categories

Sub-categories are defined by naming after a period:

    {category}.{sub-category}

For example, `api` has some sub-categories:

- `commands`
- `events`

Specifying `api.events` as a category will only show logs relevant to api events.

But specifying the main category (`api` in this case) will show logs for all sub-categories under the main category. So `api`, `api.commands`, and `api.events` will show up in the logs.