Skip to contents

Provides access to logging functionality provided through the web API.

Details

A new instance of this class will be created by the ServiceProvider automatically.

Super class

Myrconn.PetroVisor.Client::ApiRequests -> LoggingService

Methods


Method new()

Create a new LoggingService instance. This is done by the ServiceProvider automatically.

Usage

LoggingService$new(url, token_type, token)

Arguments

url

the URL for the API calls.

token_type

the type of the issued token.

token

the issued token.


Method load_categories()

Get all available categories from the existing log entries.

Usage

LoggingService$load_categories()

Returns

A character vector containing all available categories.


Method load()

Retrieve all log entries matching the given filter from the database.

Usage

LoggingService$load(
  last_entries = NULL,
  start = NULL,
  end = NULL,
  categories = NULL,
  user_name = NULL,
  severities = NULL,
  message_text_filter = NULL,
  workflow = NULL,
  schedule = NULL
)

Arguments

last_entries

Return only the latest n tag entries.

start

Return log entries after the specified date (inclusive).

end

Return log entries before the specified date (inclusive).

categories

Return log entries of the specified categaories.

user_name

Return log entries of the specified user.

severities

Return log entries of the given severities.

message_text_filter

Return log entries whose massage contains the specified text.

workflow

Return log entries for the specified workflow.

schedule

Return log entries for the specified schedule.

Returns

A dataframe containing the requested log entries. The number of returned columns depends on the available information. Columns that contain no information are not shown in the output.


Method save()

Add one or several log entries to the database at once.

Usage

LoggingService$save(log_entries)

Arguments

log_entries

a list of LogEntry-objects.


Method delete()

Remove log entries from the database.

Usage

LoggingService$delete(days_to_keep = 0, category)

Arguments

days_to_keep

Keep the log entries of the last n days in the log. Defaults to 0.

category

Remove log entries of the specified category only.


Method clone()

The objects of this class are cloneable with this method.

Usage

LoggingService$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# create a new instance of the service provider
sp <- ServiceProvider$new("Host", 8095, "WorkspaceA", "UserX", "Password")

# get available categories
availableCategories <- sp$logs$GetAvailableCategories()

# get log entries
allLogEntries <- sp$logs$GetLogEntries()
warnings <- sp$logs$GetLogEntries(severity = "Warning")
signIns <- sp$logs$GetLogEntries(category = "SignIn")

# add log entry
entry <- LogEntry$new(message = "Test",
                      category = "Tag",
                      severity = "Information")
sp$logs$AddLogEntry(entry)

# add several log entries at once
entry1 <- LogEntry$new(message = "Test1",
                       category = "Tag",
                       severity = "Information")
entry2 <- LogEntry$new(message = "Test2",
                       category = "Tag",
                       severity = "Information")
sp$logs$AddLogEntries(list(entry1, entry2))

# remove all log entries
sp$logs$CleanUpLogEntries()
} # }