Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogCmd = &cobra.Command{ Use: "log SERVER", Aliases: []string{"logs"}, Short: "Retrieve and display server logs", Long: `Retrieve and display logs for a specified server. This command allows you to view logs of different levels and types associated with a server. Use the '--tail' flag to show the newest N log entries. Suitable for debugging and monitoring server activities.`, Example: ` alpacon log my-server alpacon logs my-server alpacon log my-server --tail=10 alpacon logs my-server --tail=10 `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { serverName := args[0] tail, _ := cmd.Flags().GetInt("tail") utils.RequirePositiveInt("tail", tail) alpaconClient, err := client.NewAlpaconAPIClient() if err != nil { utils.CliErrorWithExit("Connection to Alpacon API failed: %s. Consider re-logging.", err) } logList, err := log.GetSystemLogList(alpaconClient, serverName, tail) utils.PrintListOrExit(logList, err, "Failed to get logs") }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.