Uses of Class
codes.grow.packages.betterstack.logging.LogRecord
Packages that use LogRecord
Package
Description
Grow Codes SDK for Better Stack Logs.
-
Uses of LogRecord in codes.grow.packages.betterstack
Methods in codes.grow.packages.betterstack that return LogRecordModifier and TypeMethodDescriptionstatic LogRecordBetterStackQuery.logRecordFromRow(Map<String, ?> row) Normalizes a{dt, raw}row into aLogRecord:body=message(elsemsg, else the raw text); severity fromseverity_number, elselevel/severitytext (default INFO), with the canonical text when the level is known; timestamp fromdt(else the event'sdt); trace ids fromspan.trace_id/span.span_id(else top-leveltrace_id/span_id, hex only);resourcefromresource; every other key plus theattributesobject into attributes.Methods in codes.grow.packages.betterstack with parameters of type LogRecordModifier and TypeMethodDescriptionstatic byte[]OtlpLogs.encodeLogRecord(LogRecord r) Encodes one OTLPLogRecordmessage.Maps a record to the Better Stack event shape (the JSON stored in therawcolumn):{dt, message, level, severity_number, span: {trace_id, span_id}, trace_flags, resource, attributes, observed_dt}.Method parameters in codes.grow.packages.betterstack with type arguments of type LogRecordModifier and TypeMethodDescriptionbyte[]Encodes records as one request body (protobuf bytes or OTLP/JSON text).static byte[]OtlpLogs.encodeProtobuf(List<LogRecord> records, String scopeName) Encodes anExportLogsServiceRequestas protobuf: oneResourceLogsper distinct resource with oneScopeLogs(scopeName, SDK version).BetterStackLogExporter.export(List<LogRecord> records, ExportOptions options) Sends the records in as few requests as the limits allow.BetterStackOtlpLogExporter.export(List<LogRecord> records, ExportOptions options) Sends the records; the future never fails for service errors (seeLogExporter).OtlpLogs.jsonRequest(List<LogRecord> records, String scopeName) Builds the OTLP/JSONExportLogsServiceRequestobject.Posts one OTLP request forrecords(no splitting).AsynchronousBetterStackOtlpLogExporter.send(List, boolean).BetterStackQuery.tail(String query, Consumer<LogRecord> onRecord, TailOptions options) PollsBetterStackQuery.searchLogs(codes.grow.packages.betterstack.SearchLogsOptions)everyoptions.interval()(default 1 s) for new records of the configured source table that containquery, starting atoptions.start()(default now), and callsonRecordfor each new record indtorder. -
Uses of LogRecord in codes.grow.packages.betterstack.logging
Methods in codes.grow.packages.betterstack.logging that return LogRecordModifier and TypeMethodDescriptionLogRecord.Builder.build()Builds the record.static LogRecordParses one record from JSON text.static LogRecordLogRecordJson.fromJsonNode(com.fasterxml.jackson.databind.JsonNode node) Parses one record from a Jackson tree.Returns a redacted copy of the record.default LogRecordLogQueryClient.waitForLog(String query) LogQueryClient.waitForLog(String, WaitForLogOptions)with defaults.default LogRecordLogQueryClient.waitForLog(String query, WaitForLogOptions options) PollsLogQueryClient.search(java.lang.String, codes.grow.packages.betterstack.logging.SearchOptions)until a record matches the query and the predicate.Methods in codes.grow.packages.betterstack.logging that return types with arguments of type LogRecordModifier and TypeMethodDescriptionBatchOptions.onDrop()Drop callback.BatchOptions.onError()Export error callback.WaitForLogOptions.predicate()Returns the value of thepredicaterecord component.LogSearchResult.records()Returns the value of therecordsrecord component.default CompletableFuture<LogRecord> LogQueryClient.waitForLogAsync(String query, WaitForLogOptions options) AsynchronousLogQueryClient.waitForLog(String, WaitForLogOptions).Methods in codes.grow.packages.betterstack.logging with parameters of type LogRecordModifier and TypeMethodDescriptionbooleanQueues a record.static intReturns the UTF-8 size of the record's JSON form (the unit ofmaxBatchBytes).Returns a redacted copy of the record.static StringSerialises a record to compact JSON.Returns the wire form as an ordered map of plain JSON values.Method parameters in codes.grow.packages.betterstack.logging with type arguments of type LogRecordModifier and TypeMethodDescriptionLogExporter.export(List<LogRecord> records, ExportOptions options) Exports a batch.static LogSearchResultA single page without cursor or total.BatchOptions.Builder.onDrop(BiConsumer<List<LogRecord>, DropReason> onDrop) Sets the drop callback (exceptions it throws are ignored).BatchOptions.Builder.onError(BiConsumer<Throwable, List<LogRecord>> onError) Sets the export error callback (exceptions it throws are ignored).default TailHandleLogQueryClient.tail(String query, Consumer<LogRecord> onRecord, TailOptions options) Streams new matching records toonRecorduntil the handle is stopped.WaitForLogOptions.withPredicate(Predicate<LogRecord> filter) Copy with a predicate.Constructor parameters in codes.grow.packages.betterstack.logging with type arguments of type LogRecordModifierConstructorDescriptionLogSearchResult(List<LogRecord> records, Optional<String> nextCursor, OptionalLong total) Copies the list and replacesnulloptionals by empty ones.WaitForLogOptions(Duration timeout, Duration interval, Predicate<LogRecord> predicate, SearchOptions search) Fills defaults fornullvalues. -
Uses of LogRecord in codes.grow.packages.betterstack.testing.logging
Methods in codes.grow.packages.betterstack.testing.logging that return types with arguments of type LogRecordModifier and TypeMethodDescriptionInMemoryLogExporter.records()Accepted records in export order.Methods in codes.grow.packages.betterstack.testing.logging with parameters of type LogRecordModifier and TypeMethodDescriptionstatic booleanWhether a record matches a query.Method parameters in codes.grow.packages.betterstack.testing.logging with type arguments of type LogRecordModifier and TypeMethodDescriptionvoidInMemoryLogExporter.enqueueOutcome(Function<List<LogRecord>, CompletableFuture<ExportResult>> outcome) Scripts the outcome of the next export call (FIFO).InMemoryLogExporter.export(List<LogRecord> batch, ExportOptions options) voidStores records as if exported (for outcomes that accept part of a batch).InMemoryLogQueryClient.tail(String query, Consumer<LogRecord> onRecord, TailOptions options) Constructor parameters in codes.grow.packages.betterstack.testing.logging with type arguments of type LogRecordModifierConstructorDescriptionInMemoryLogQueryClient(Supplier<List<LogRecord>> source) Reads records from a supplier.