- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Send logs to Datadog from your Unity applications with Datadog’s Unity Package and leverage the following features:
To initialize the Datadog Unity SDK for Logs, see Setup.
Once you have setup the Datadog Unity SDK, you can use the SDK’s DefaultLogger
to send logs to Datadog.
var logger = DatadogSdk.Instance.DefaultLogger;
logger.Debug("A debug message.");
logger.Info("Some relevant information?");
logger.Warn("An important warning…");
logger.Error("An error was met!");
If you set the “Forward Unity Logs” option, logs sent to Unity using Unity’s Debug.Log*
methods are automatically sent to DatadogSdk.Instance.DefaultLogger
.
You can create additional loggers with different services and names using the CreateLogger
method as well:
var loggingOptions = new DatadogLoggingOptions()
{
Service = "com.example.custom_service",
Name = "Additional logger",
};
var logger = DatadogSdk.Instance.CreateLogger(loggingOptions);
logger.Info('Info from my additional logger.');
Tags set on loggers are local to each logger.
Use the DdLogger.AddTag
method to add tags to all logs sent by a specific logger:
// This adds a "build_configuration:debug" tag
logger.AddTag("build_configuration", "debug")
Use the DdLogger.RemoveTag
method to remove tags from all logs sent by a specific logger:
// This removes any tag that starts with "build_configuration"
logger.RemoveTag("build_configuration")
For more information, see Getting Started with Tags.
Attributes set on loggers are local to each logger.
By default, the following attributes are added to all logs sent by a logger:
http.useragent
and its extracted device
and OS
propertiesnetwork.client.ip
and its extracted geographical properties (country
, city
)logger.version
, Datadog SDK versionlogger.thread_name
, (main
, background
)version
, client’s app version extracted from either the Info.plist
or application.manifest
environment
, the environment name used to initialize the SDKUse the DatadogLogger.AddAttribute
method to add a custom attribute to all logs sent by a specific logger:
logger.AddAttribute("user-status", "unregistered")
The value
can be most types that can be serialized using JsonCovert.SerializeObject
.
Use the DdLogger.RemoveAttribute
method to remove a custom attribute from all logs sent by a specific logger:
// This removes the attribute "user-status" from all logs sent moving forward.
logger.RemoveAttribute("user-status")
추가 유용한 문서, 링크 및 기사: