# Follow/tail the log stream
kf logs myapp
# Follow/tail the log stream with 20 lines of context
kf logs myapp -n 20
# Get recent logs from the App
kf logs myapp --recent
# Get the most recent 200 lines of logs from the App
kf logs myapp --recent -n 200
# Get the logs of Tasks running from the App
kf logs myapp --task
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# kf logs\n\n### Name\n\n`kf logs` - Show logs for an App.\n\n### Synopsis\n\n```\nkf logs APP_NAME [flags]\n```\n\n### Description\n\nLogs are streamed from the Kubernetes log endpoint for each running\nApp instance.\n\nIf App instances change or the connection to Kubernetes times out the\nlog stream may show duplicate logs.\n\nLogs are retained for App instances as space permits on the cluster,\nbut will be deleted if space is low or past their retention date.\nCloud Logging is a more reliable mechanism to access historical logs.\n\nIf you need logs for a particular instance use the `kubectl` CLI.\n\n### Examples\n\n```\n# Follow/tail the log stream\nkf logs myapp\n\n# Follow/tail the log stream with 20 lines of context\nkf logs myapp -n 20\n\n# Get recent logs from the App\nkf logs myapp --recent\n\n# Get the most recent 200 lines of logs from the App\nkf logs myapp --recent -n 200\n\n# Get the logs of Tasks running from the App\nkf logs myapp --task\n```\n\n### Flags\n\n`-h, --help`\n\n: help for logs\n\n`-n, --number=`\u003cvar translate=\"no\"\u003eint\u003c/var\u003e\n\n: Show the last N lines of logs. (default 10)\n\n`--recent`\n\n: Dump recent logs instead of tailing.\n\n`--task`\n\n: Tail Task logs instead of App.\n\n### Inherited flags\n\nThese flags are inherited from parent commands.\n\n`--as=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Username to impersonate for the operation.\n\n`--as-group=`\u003cvar translate=\"no\"\u003estrings\u003c/var\u003e\n\n: Group to impersonate for the operation. Include this flag multiple times to specify multiple groups.\n\n`--config=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Path to the Kf config file to use for CLI requests.\n\n`--kubeconfig=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Path to the kubeconfig file to use for CLI requests.\n\n`--log-http`\n\n: Log HTTP requests to standard error.\n\n`--space=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Space to run the command against. This flag overrides the currently targeted Space."]]