| AppenderElasticSearch {lgrExtra} | R Documentation |
Log to ElasticSearch
Description
Log to ElasticSearch via HTTP
Details
NOTE: Experimental; not yet fully documented and and details are subject to change
Value
The $new() method returns an R6::R6 that inherits from
lgr::Appender and can be uses as an appender by a lgr::Logger.
Super classes
lgr::Filterable -> lgr::Appender -> lgr::AppenderMemory -> AppenderElasticSearch
Active bindings
connclose_on_exitTRUEorFALSE. Close the ElasticSearch connection when the Logger is removed?indexa
characterscalar or a DBI::Id specifying the target ElasticSearch index
Methods
Public methods
Inherited methods
lgr::Filterable$add_filter()lgr::Filterable$filter()lgr::Filterable$remove_filter()lgr::Filterable$set_filters()lgr::Appender$set_layout()lgr::Appender$set_threshold()lgr::AppenderMemory$append()lgr::AppenderMemory$clear()lgr::AppenderMemory$format()lgr::AppenderMemory$set_buffer_size()lgr::AppenderMemory$set_flush_on_exit()lgr::AppenderMemory$set_flush_on_rotate()lgr::AppenderMemory$set_flush_threshold()lgr::AppenderMemory$set_should_flush()
Method new()
Usage
AppenderElasticSearch$new( conn, index, threshold = NA_integer_, layout = LayoutElasticSearch$new(), close_on_exit = TRUE, buffer_size = 0, flush_threshold = "error", flush_on_exit = TRUE, flush_on_rotate = TRUE, should_flush = NULL, filters = NULL )
Arguments
conn, indexsee section Fields
threshold, flush_threshold, layout, buffer_sizesee AppenderBuffer A data
data.frame. content of index
Method set_close_on_exit()
Usage
AppenderElasticSearch$set_close_on_exit(x)
Method set_conn()
Usage
AppenderElasticSearch$set_conn(conn)
Method get_data()
Usage
AppenderElasticSearch$get_data( n = 20L, threshold = NA, result_type = "data.frame" )
Arguments
nintegerscalar. Retrieve only the lastnlog entries that matchthresholdthresholdcharacterorintegerscalar. The minimum log level that should be displayedresult_typecharacterscalar. Any of:-
data.frame -
data.table(shortcut:dt) -
list(unprocessed list with ElasticSearch metadata) -
json(raw ElasticSearch JSON)
-
Returns
see result_type
Method show()
Usage
AppenderElasticSearch$show(threshold = NA_integer_, n = 20)
Method flush()
Usage
AppenderElasticSearch$flush()
See Also
Other Appenders:
AppenderDbi,
AppenderDt,
AppenderGmail,
AppenderPushbullet,
AppenderSendmail,
AppenderSyslog