如何在Pod中查看应用程序日志

时间:2019-01-03 07:24:09

标签: kubernetes

我们正朝着微服务方向发展,并使用K8S进行集群编排。我们正在使用Dynatrace和Prometheus服务器构建用于收集指标的基础设施,但它们的状态尚不理想。 我们在其中一个Pod上的Java应用程序无法正常工作。我想查看应用程序日志。

如何访问这些日志?

1 个答案:

答案 0 :(得分:2)

假设应用程序登录到标准输出/错误Sub ModifyFooter() ' 03 Jan 2019 Dim Doc As Document Dim Txt As String Dim Foot As HeaderFooter Dim Para As Paragraph Dim Rng As Range Dim i As WdHeaderFooterIndex Set Doc = ActiveDocument For i = wdHeaderFooterPrimary To wdHeaderFooterFirstPage Set Foot = Doc.Sections(1).Footers(i) Txt = "This document was last printed on " Set Para = Foot.Range.Paragraphs(1) Set Rng = Para.Range With Rng .Text = Txt .Collapse wdCollapseEnd End With Txt = "\@ ""dd.MM.yyyy""" Doc.Fields.Add Rng, wdFieldPrintDate, Text:=Txt, PreserveFormatting:=True Next i End Sub