Custom Properties

Custom Properties

Properties are simple key-value attribute pairs that can be sent along with the log message payload and are yet another way to provide visibility into your app’s state. Only a maximum of 10 properties are allowed to be set. Currently only string types are allowed to be keys. Values can be any of the following supported types.

App Moments

To attach properties to an app moment, send them at the start of the moment by passing it as an additional parameter.

boolean shouldTakeScreenshot = true;

Map<String, Object> props = new HashMap<>();

props.put("user-id", "daniel");
props.put("frequent-flyer", 12345678);
props.put("is-admin", false);

Embrace.getInstance().sendEvent("user-login", null, shouldTakeScreenshot, props);

Log Messages

Properties can be sent along with any log message type: INFO, WARNING, ERROR.

Embrace.getInstance().logInfo("Suspicious user was identified!", null);

Map<String, Object> props = new HashMap<>();

props.put("name", "Daniel");
props.put("age", 25);
props.put("score", 102.2);
props.put("is-new-record", true);

Embrace.getInstance().logError("User with impossible score detected!", props);