This documentation is deprecated. Please refer to the README in the Appium repository or Appium 2.0 documentation.

  Edit this Doc Appium Logs Filtering

Sometimes it might be necessary to hide sensitive information, like passwords, identifiers, hashes, etc from the server log. Since version 1.18.0 Appium supports --log-filters command line argument. This argument allows to provide the path to a special config file, containing one or more log obfuscation rules.

Config Format

The filtering config must be a valid JSON file containing array of filtering rules. Each rule is an object with a set of predefined properties. The following rule properties are supported:

Config Examples

Replace all occurrences of my.magic.app string with the default replacer:

[
    {
        "text": "my.magic.app"
    }
]

Replace all occurrences of my.magic.<any char> string with a custom replacer (case insensitive):

[
    {
        "pattern": "my\\.magic\\.\\w",
        "flags": "i",
        "replacer": "***"
    }
]

Replace all occurrences of my.magic.<any chars> and/or your.magic strings with a custom replacer (case insensitive):

[
    {
        "pattern": "my\\.magic\\.\\w+",
        "flags": "i",
        "replacer": "***"
    },
    {
        "pattern": "your\\.magic",
        "flags": "i",
        "replacer": "***"
    }
]

Cut off all log lines to max 15 chars (advanced):

[
    {
        "pattern": "(.{1,15}).*",
        "flags": "s",
        "replacer": "$1"
    }
]

Config Errors Handling

If any of config rules contains invalid items (such as empty/invalid pattern, empty rule, etc.) then Appium will print the detailed report about collected errors and will fail to start until these errors are addressed.