Codota Logo
LogEntry.toBuilder
Code IndexAdd Codota to your IDE (free)

How to use
toBuilder
method
in
com.google.cloud.logging.LogEntry

Best Java code snippets using com.google.cloud.logging.LogEntry.toBuilder (Showing top 3 results out of 315)

  • Common ways to obtain LogEntry
private void myMethod () {
LogEntry l =
  • Codota IconLogEntry.Builder logEntryBuilder;logEntryBuilder.build()
  • Smart code suggestions by Codota
}
origin: googleapis/google-cloud-java

@Override
public void run(Logging logging, LogEntry entry) {
 MonitoredResource resource =
   MonitoredResource.newBuilder("global")
     .addLabel("project_id", logging.getOptions().getProjectId())
     .build();
 LogEntry entryWithResource = entry.toBuilder().setResource(resource).build();
 logging.write(Collections.singleton(entryWithResource));
 System.out.printf("Written entry %s%n", entryWithResource);
}
origin: googleapis/google-cloud-java

@Test
public void testWriteLogEntriesDoesnotEnableFlushByDefault() {
 WriteLogEntriesRequest request =
   WriteLogEntriesRequest.newBuilder()
     .addAllEntries(
       Iterables.transform(
         ImmutableList.of(
           LOG_ENTRY1, LOG_ENTRY2.toBuilder().setSeverity(Severity.EMERGENCY).build()),
         LogEntry.toPbFunction(PROJECT)))
     .build();
 ApiFuture<WriteLogEntriesResponse> apiFuture = SettableApiFuture.create();
 EasyMock.expect(loggingRpcMock.write(request)).andReturn(apiFuture);
 EasyMock.replay(rpcFactoryMock, loggingRpcMock);
 logging = options.getService();
 logging.write(
   ImmutableList.of(
     LOG_ENTRY1, LOG_ENTRY2.toBuilder().setSeverity(Severity.EMERGENCY).build()));
}
origin: googleapis/google-cloud-java

@Test
public void testToBuilder() {
 compareLogEntry(STRING_ENTRY, STRING_ENTRY.toBuilder().build());
 HttpRequest request =
   HttpRequest.newBuilder()
 LogEntry logEntry =
   STRING_ENTRY
     .toBuilder()
     .setPayload(StringPayload.of("otherPayload"))
     .setLogName("otherLogName")
 logEntry =
   logEntry
     .toBuilder()
     .setPayload(STRING_PAYLOAD)
     .setLogName(LOG_NAME)
com.google.cloud.loggingLogEntrytoBuilder

Javadoc

Returns a Builder for this log entry.

Popular methods of LogEntry

  • newBuilder
    Returns a builder for LogEntry objects given the entry payload.
  • getSpanId
    Returns the ID of the trace span associated with the log entry, if any.
  • getTrace
    Returns the resource name of the trace associated with the log entry, if any. If it contains a relat
  • fromPb
  • getSeverity
    Returns the severity of the log entry. If not set, Severity#DEFAULT is used.
  • getTimestamp
    Returns the time at which the event described by the log entry occurred, in milliseconds. If omitted
  • getTraceSampled
    Returns the sampling decision of the trace span associated with the log entry, or falseif there is n
  • of
    Creates a LogEntry object given the log name, the monitored resource and the entry payload.
  • toPb
  • toPbFunction
  • <init>
  • getHttpRequest
    Returns information about the HTTP request associated with this log entry, if applicable.
  • <init>,
  • getHttpRequest,
  • getInsertId,
  • getLabels,
  • getLocation,
  • getLogName,
  • getOperation,
  • getPayload,
  • getReceiveTimestamp

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JLabel (javax.swing)
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now