确认环境中所有应用程序和服务的日志记录设置正确并启用。
确认应用程序和服务的代码中是否正确使用了日志库。例如,在 .NET Core 中,确保通过添加以下包引用使用 Microsoft.Extensions.Logging:
确保在代码中正确配置 ILogger 对象:
using Microsoft.Extensions.Logging;
namespace MyApp
{
public class MyService
{
private readonly ILogger _logger;
public MyService(ILogger logger)
{
_logger = logger;
}
public void DoSomething()
{
_logger.LogInformation("Doing something...");
}
}
}
sudo apt-get update
sudo apt-get install -y curl libunwind8 gettext apt-transport-https
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" | sudo tee /etc/apt/sources.list.d/dotnetdev.list
sudo apt-get update
sudo apt-get install -y dotnet-sdk-2.2
sudo apt-get install -y libgdiplus
sudo apt-get install -y libc6-dev libsqlite3-dev libicu-dev libssl-dev libunwind-dev