LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Llms
  • Profile
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
UniversalHubNodeLoadSerializableEncoder BackedFile SystemIn Memory
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsLlmsProfileLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStreamTestingTiktokenTypesVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/coretracerslog_stream
Moduleā—Since v1.0

tracers/log_stream

Copy
import { ... } from "@langchain/core/tracers/log_stream";

Functions

function
isLogStreamHandler→ handler is LogStreamCallbackHandler

Classes

class
LogStreamCallbackHandler

Class that extends the BaseTracer class from the langchain.callbacks.tracers.base module. It represents a callback handler that logs the execution of runs and emits RunLog instances to a RunLogStream.

class
RunLog

List of jsonpatch JSONPatchOperations, which describe how to create the run state from an empty dict. This is the minimal representation of the log, designed to be serialized as JSON and sent over the wire to reconstruct the log on the other side. Reconstruction of the state can be done with any jsonpatch-compliant library, see https://jsonpatch.com for more information.

class
RunLogPatch

List of jsonpatch JSONPatchOperations, which describe how to create the run state from an empty dict. This is the minimal representation of the log, designed to be serialized as JSON and sent over the wire to reconstruct the log on the other side. Reconstruction of the state can be done with any jsonpatch-compliant library, see https://jsonpatch.com for more information.

Interfaces

interface
LogStreamCallbackHandlerInput

Interface for the input parameters of the BaseCallbackHandler class. It allows to specify which types of events should be ignored by the callback handler.

Type Aliases

typeAlias
LogEntry

Interface that represents the structure of a log entry in the LogStreamCallbackHandler.

typeAlias
RunState
typeAlias
SchemaFormat: "original" | "streaming_events"
typeAlias
StreamEvent

A streaming event.

Schema of a streaming event which is produced from the streamEvents method.

typeAlias
StreamEventData

Data associated with a StreamEvent.

View source on GitHub