日志 logs
更新时间 2025-10-23 09:41:29
最近更新时间: 2025-10-23 09:41:29
logs命令查看函数的日志。
参数解析
| 参数全称 | 参数缩写 | Yaml 模式下必填 | Cli 模式下必填 | 参数含义 |
|---|---|---|---|---|
| region | - | 选填 | 必填 | 资源池ID,请参考资源池列表 |
| function-name | - | 选填 | 必填 | 函数名称 |
| start-time | s | 选填 | 选填 | 开始时间戳,例如:1752740881 |
| end-time | e | 选填 | 选填 | 结束时间戳,例如:1754036841 |
| search | - | 选填 | 选填 | 查询关键字 |
| reverse | - | 选填 | 选填 | 按时间倒序显示 |
操作案例
Yaml 模式
进入到资源描述文件(s.yaml)所在的路径,然后执行如下命令查看函数的日志:
s logsCli 模式
直接执行如下命令查看函数的日志:
s cli faas-cf logs --region bb9fdb42056f11eda1610242ac110002 --function-name hello-world执行完成输出示例:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.8.RELEASE)
2025-10-22 10:20:05.689 INFO 2 --- [ main] c.e.w.WebFrameworkApplication : Starting WebFrameworkApplication v0.0.1-SNAPSHOT on globalresource-cached-rj46v with PID 2 (/code/webframework.jar started by root in /code)
2025-10-22 10:20:05.691 INFO 2 --- [ main] c.e.w.WebFrameworkApplication : No active profile set, falling back to default profiles: default
2025-10-22 10:20:08.014 INFO 2 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9000 (http)
2025-10-22 10:20:08.086 INFO 2 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2025-10-22 10:20:08.086 INFO 2 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.24]
2025-10-22 10:20:08.213 INFO 2 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2025-10-22 10:20:08.213 INFO 2 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2413 ms
2025-10-22 10:20:08.601 INFO 2 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2025-10-22 10:20:08.916 INFO 2 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9000 (http) with context path ''
2025-10-22 10:20:08.918 INFO 2 --- [ main] c.e.w.WebFrameworkApplication : Started WebFrameworkApplication in 4.12 seconds (JVM running for 4.846)
2025-10-22 10:20:09.020 INFO 2 --- [nio-9000-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-10-22 10:20:09.020 INFO 2 --- [nio-9000-exec-2] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2025-10-22 10:20:09.026 INFO 2 --- [nio-9000-exec-2] o.s.web.servlet.DispatcherServlet : Completed initialization in 6 ms