public class Context extends Object implements Serializable
Breadcrumb
s)
so that data may be collected in different parts of an application and
then sent together when an exception occurs.Constructor and Description |
---|
Context()
Create a new (empty) Context object with the default Breadcrumb limit.
|
Context(int breadcrumbLimit)
Create a new (empty) Context object with the specified Breadcrumb limit.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear state from this context.
|
void |
clearUser()
Clears the current user set on this context.
|
Iterator<Breadcrumb> |
getBreadcrumbs()
Return
Breadcrumb s attached to this Context. |
UUID |
getLastEventId()
Get the UUID of the last event sent by this thread, useful for handling user feedback.
|
User |
getUser()
Gets the current user from the context.
|
void |
recordBreadcrumb(Breadcrumb breadcrumb)
Record a single
Breadcrumb into this context. |
void |
setLastEventId(UUID id)
Store the UUID of the last sent event by this thread, useful for handling user feedback.
|
void |
setUser(User user)
Store the current user in the context.
|
public Context()
public Context(int breadcrumbLimit)
breadcrumbLimit
- Number of Breadcrumb objects to retain in ring buffer.public void clear()
public Iterator<Breadcrumb> getBreadcrumbs()
Breadcrumb
s attached to this Context.Breadcrumb
s.public void recordBreadcrumb(Breadcrumb breadcrumb)
Breadcrumb
into this context.breadcrumb
- Breadcrumb object to recordpublic void setLastEventId(UUID id)
id
- UUID of the last event sent by this thread.public UUID getLastEventId()
public void setUser(User user)
user
- User to store in context.public void clearUser()
public User getUser()
Copyright © 2012–2017. All rights reserved.