Copy
---
title: Log10
---
이 페이지는 LangChain 내에서 [Log10](https://log10.io)을 사용하는 방법을 다룹니다.
## Log10이란 무엇인가요?
Log10은 LangChain 호출을 로깅, 디버깅 및 태깅할 수 있는 [오픈소스](https://github.com/log10-io/log10) proxiless LLM 데이터 관리 및 애플리케이션 개발 플랫폼입니다.
## 빠른 시작
1. [log10.io](https://log10.io)에서 무료 계정을 생성하세요
2. Settings 및 Organization 탭에서 각각 `LOG10_TOKEN`과 `LOG10_ORG_ID`를 환경 변수로 추가하세요.
3. 또한 `LOG10_URL=https://log10.io`와 일반적으로 사용하는 LLM API key를 추가하세요: 예를 들어 `OPENAI_API_KEY` 또는 `ANTHROPIC_API_KEY`를 환경에 추가합니다
## LangChain에 Log10 데이터 관리를 활성화하는 방법
log10과의 통합은 아래와 같이 간단한 한 줄의 `log10_callback` 통합입니다:
```python
from langchain_openai import ChatOpenAI
from langchain.messages import HumanMessage
from log10.langchain import Log10Callback
from log10.llm import Log10Config
log10_callback = Log10Callback(log10_config=Log10Config())
messages = [
HumanMessage(content="You are a ping pong machine"),
HumanMessage(content="Ping?"),
]
llm = ChatOpenAI(model="gpt-3.5-turbo", callbacks=[log10_callback])
Log10에서 tag를 사용하는 방법
Copy
from langchain_openai import OpenAI
from langchain_community.chat_models import ChatAnthropic
from langchain_openai import ChatOpenAI
from langchain.messages import HumanMessage
from log10.langchain import Log10Callback
from log10.llm import Log10Config
log10_callback = Log10Callback(log10_config=Log10Config())
messages = [
HumanMessage(content="You are a ping pong machine"),
HumanMessage(content="Ping?"),
]
llm = ChatOpenAI(model="gpt-3.5-turbo", callbacks=[log10_callback], temperature=0.5, tags=["test"])
completion = llm.predict_messages(messages, tags=["foobar"])
print(completion)
llm = ChatAnthropic(model="claude-2", callbacks=[log10_callback], temperature=0.7, tags=["baz"])
llm.predict_messages(messages)
print(completion)
llm = OpenAI(model_name="gpt-3.5-turbo-instruct", callbacks=[log10_callback], temperature=0.5)
completion = llm.predict("You are a ping pong machine.\nPing?\n")
print(completion)
Copy
import os
from log10.load import log10, log10_session
import openai
from langchain_openai import OpenAI
log10(openai)
with log10_session(tags=["foo", "bar"]):
# Log a direct OpenAI call
response = openai.Completion.create(
model="text-ada-001",
prompt="Where is the Eiffel Tower?",
temperature=0,
max_tokens=1024,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
)
print(response)
# Log a call via LangChain
llm = OpenAI(model_name="text-ada-001", temperature=0.5)
response = llm.predict("You are a ping pong machine.\nPing?\n")
print(response)
LangChain 호출을 디버깅하는 방법
디버깅 예제 더 많은 LangChain 예제Copy
---
<Callout icon="pen-to-square" iconType="regular">
[Edit the source of this page on GitHub.](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/log10.mdx)
</Callout>
<Tip icon="terminal" iconType="regular">
[Connect these docs programmatically](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
</Tip>