---
title: "init(subsystem:category:)"
framework: os
role: symbol
role_heading: Initializer
path: "os/oslog/init(subsystem:category:)-72ghw"
---

# init(subsystem:category:)

Creates a log using the specified subsystem and system-defined category.

## Declaration

```swift
convenience init(subsystem: String, category: OSLog.Category)
```

## Parameters

- `subsystem`: An identifier string, in reverse DNS notation, that represents the subsystem that’s performing logging, such as com.your_company.your_subsystem_name. The logging system uses this information to categorize and filter related log messages.
- `category`: A system-defined category within the specified subsystem. The system uses this value to categorize and filter related log messages. A category’s logging settings override those of the containing subsystem.

## Return Value

Return Value  A custom log object that you can pass to other logging functions to perform logging and to determine whether a specific level of logging is in an enabled state.

## See Also

### Creating a Log

- [init(subsystem:category:)](os/oslog/init(subsystem:category:)-17gyy.md)
- [OSLog.Category](os/oslog/category.md)
