Class Logs

  • All Implemented Interfaces:
    com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>

    public class Logs
    extends CommandWithArgumentList<Logs>
    A representation of the Docker logs command.

    Instances of Logs are immutable, methods that add options and configuration to this Logs command return a new instance of a Logs command with the modifications applied.

    Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
    Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

    Author:
    Jonathan Knight
    • Method Detail

      • follow

        public Logs follow​(boolean enabled)
        Follow log output (equates to the --follow argument).
        Parameters:
        enabled - should follow logging be enabled
        Returns:
        a new Logs instance that is the same as this instance with the --follow option applied
      • since

        public Logs since​(Object timestamp)
        Show logs since timestamp (equates to the --since argument).
        Parameters:
        timestamp - a value that resolves to the timestamp to use to determine the logs to show
        Returns:
        a new Logs instance that is the same as this instance with the --since option applied
      • tail

        public Logs tail​(Object numberOfLines)
        Show the specified number of lines to from the end of the logs (equates to the --tail argument).
        Parameters:
        numberOfLines - a value that resolves to the number of log lines to show, or equates to "all" to show all lines
        Returns:
        a new Logs instance that is the same as this instance with the --tail option applied
      • from

        public static Logs from​(Object containerName)
        Create a Logs command to view the logs from a specific container.
        Parameters:
        containerName - the containe to view the logs for
        Returns:
        a Logs command to view the logs from a specific container
      • withCommandArguments

        protected Logs withCommandArguments​(List<com.oracle.bedrock.runtime.options.Argument> endArgs,
                                            com.oracle.bedrock.runtime.options.Argument... args)
        Description copied from class: CommandWithArgumentList
        Obtain a copy of this CommandWithArgumentList with the addition of the specified command arguments Arguments.
        Specified by:
        withCommandArguments in class CommandWithArgumentList<Logs>
        Parameters:
        endArgs - the List of Arguments that appear at the end of the command line
        args - the new command to add
        Returns:
        a copy of this CommandWithArgumentList with the addition of the specified command arguments Arguments