<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/OSLog/init(subsystem:category:)-17gyy",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "s:So9OS_os_logC0B0E9subsystem8categoryABSS_SStcfc"
  },
  "title" : "init(subsystem:category:)"
}
-->

# init(subsystem:category:)

Creates a log using the specified subsystem and category.

```
convenience init(subsystem: String, category: String)
```

## Parameters

`subsystem`

An identifier string, in reverse DNS notation, that represents the app subsystem that’s logging information, such as `com.your_company.your_subsystem_name`. The logging system uses this information to categorize and filter related log messages, and to group related logging settings.

`category`

A category within the specified subsystem. The system uses this value to categorize and filter related log messages, and to group related logging settings within the subsystem. A category’s logging settings override those of the containing subsystem.

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)