
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
trpc.group/trpc-go/trpc-gateway/plugin/accesslog
Advanced tools
You can use this plugin to record request logs to a local file or report them to a remote log platform.
accesslog logger is not configured, the default trpc logger will be used for output.import (
_ "trpc.group/trpc-go/trpc-gateway/plugin/accesslog"
)
Note: Make sure to register it in server.service.filter, not in server.filter.
global: # Global configuration
server: # Server configuration
filter: # Interceptor list for all service handler functions
service: # Business services provided, can have multiple
- name: trpc.inews.trpc.gateway # Route name of the service
filter:
- accesslog # Gateway plugin registered in the service filter, so that it can be dynamically loaded in router.yaml
plugins: # Plugin configuration
gateway: # Plugin type is gateway
accesslog: # Access log plugin
log: # Log configuration
accesslog: # Configure access log output
- writer: console # Console standard output (default)
level: debug # Log level for standard output
- writer: file # Local file log
level: debug # Log level for local file rolling log
writer_config: # Specific configuration for local file output
log_path: ${log_path} # Local file log path
filename: access.log # Local file log filename
roll_type: size # File rolling type, size for rolling by size
max_age: 7 # Maximum number of days to keep logs
max_size: 10 # Size of local file rolling log in MB
max_backups: 10 # Maximum number of log files
compress: false # Whether to compress log files
- writer: atta # Other remote logs, such as Tencent's internal atta log platform
level: info
remote_config:
agent_address: ${atta_agent_address}
atta_id: 'xxx'
atta_token: 'xxx'
message_key: msg
field: # Note: the order of fields reported to atta cannot be changed
- path
- upstream_path
- router_id
- err_no
- err_msg
- local_ip
- upstream_service
- upstream_protocol
- upstream_addr
- upstream_status
- upstream_response_time
- remote_addr
- traceid
- user_agent
- host
- referer
- server_protocol
- xxx # Other business fields
Configure the plugin in the router.yaml file of the gateway, supporting global, service, and router-level plugin configurations.
router: # Router configuration
- method: /v1/user/info
target_service:
- service: trpc.user.service
plugins:
- name: accesslog
props:
field_list:
- log_key: request_key # Business field
client: # Upstream service configuration, consistent with the trpc protocol
- name: trpc.user.service
plugins:
- name: accesslog # Service-level configuration, effective for interfaces forwarded to this service
props:
plugins:
- name: accesslog # Global configuration, effective for all interfaces
props:
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.