Cobalt NetLog
Stay organized with collections
Save and categorize content based on your preferences.
Chromium has a very useful network diagnostic tool called the NetLog and Cobalt
is hooked up to use it. It's the main tool to track network traffic and debug
network code.
Activate the NetLog
The following command line switch will activate the NetLog and store net log
record to the specified location.
./cobalt --net_log=/PATH/TO/YOUR_NETLOG_NAME.json
The output json file will be stored at the file location you choose.
Read the NetLog records
The produced json file is not human-friendly, use the
NetLog Viewer
Cobalt's net_log can not enable some features in the web viewer, but all the
network traffic is recorded in the event tab.
Add NetLog entries
To Add NetLog entry, get the NetLog instance owned by NetworkModule to where you
want to add entries and start/end your entry according to the NetLog interface.
A NetLog object is created at each NetworkModule initialization and is passed
into Chromium net through URLRequestContext.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-12-12 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-12-12 UTC."],[[["Cobalt utilizes Chromium's NetLog for network diagnostics, allowing developers to track traffic and debug network code."],["NetLog is activated via command line switch `--net_log=/PATH/TO/YOUR_NETLOG_NAME.json`, storing records in a specified JSON file."],["Use the online NetLog Viewer to analyze the JSON file for network events and traffic details."],["Developers can add custom NetLog entries within their code using the NetworkModule's NetLog instance."]]],["Cobalt utilizes Chromium's NetLog for network traffic tracking and debugging. To activate it, use the command `--net_log=/PATH/TO/YOUR_NETLOG_NAME.json`, which stores network records in a JSON file. This file can be viewed using the NetLog Viewer, although some features may be limited. Network entries are recorded in the event tab. To add custom entries, obtain the NetLog instance from NetworkModule and utilize the NetLog interface to start/end entries. A NetLog object is created upon each NetworkModule initialization.\n"]]