Logging
Defender for iOS provides logging levels for monitoring activity while hardening your application and providing details when a warning or failure arises. The amount of data captured in log files is configurable.
Configuring Logging
Defender for iOS supports logging into the console, as well as to a local file. This information can be specified via command line arguments, or within the configuration file.
Command Line:
To specify the log level on the command line, use the following:
-l {0,1,2, or 3} OR --log-file-level {0,1,2, or 3}
To specify the log file directory on the command line, use the following:
-d {path to directory} OR --log-file-dir {path to directory}
Configuration File:
To specify logging via the configuration file, use the following values in your config.yaml
file:
Unset
log:
file:
level: {0,1,2, or 3}
dir: {path to directory}
Different Logging Levels
Defender for iOS provides 4 levels of logging during runtime, recorded to a file. Each level includes information from any lower level of logging. For example, Level 2 includes information described in Level 1. Each level is described below:
- Level 0: Disabled - Data is not recorded to a file during the execution of Defender for iOS.
- Please note: some general system information will always be output to the console, such as the system information and process completion. Level 1 (default): Important - Outputs important information, such as error messages, exceptions, and successful major task completion.
- Example: ‘Error: The license [############################BF28] expired on 2023-04-10. Please contact sales or support for assistance.’
- Level 2: Informational - Records individual files being processed and expanded information of processes in Level 1.
- Example: ‘Processing /assets/logo.png’
- Level 3: Debug - Records useful information for debugging and product development.
- Example:
1697567477 - TRACE <SWFL> SWIFTFLATTEN: src size: 852
1697567477 - TRACE <SWFL> SwiftFlattenRewriter.init(fileStat:ast:nameGenerator:filter:shuffleCases:randomCases:): 'SampleProject/View/Home/BrandItemView.swift'
1697567477 - TRACE <SWFL> SwiftFlattenRewriter.init(fileStat:ast:nameGenerator:filter:shuffleCases:randomCases:): declsToRewrite[0]
1697567477 - TRACE <SWFL> SWIFTFLATTEN: fluttened size: 852