Skip to content

Commit

Permalink
refactor: log server run info
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed May 3, 2024
1 parent 7e8ad8d commit a0718d0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A reverse proxy like nginx, built on [pingora](https://github.com/cloudflare/pingora), simple and efficient.

[中文说明](./READMD_zh.md)
[中文说明](./README_zh.md)

## Feature

Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
- [ ] fix not_before not_after of cert
- [ ] client body size limit plugin
- [ ] disable notification event
- [ ] convert plugin category to string?
- [ ] use buffer writer for log
- [x] convert plugin category to string?
- [x] support i18n
- [x] access log format performance
- [x] support etcd or other storage for config
Expand Down
7 changes: 7 additions & 0 deletions src/proxy/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl ServerConf {
}

pub struct Server {
name: String,
admin: bool,
addr: String,
accepted: AtomicU64,
Expand Down Expand Up @@ -236,6 +237,7 @@ impl Server {
}

Ok(Server {
name: conf.name,
admin: conf.admin,
accepted: AtomicU64::new(0),
processing: AtomicI32::new(0),
Expand Down Expand Up @@ -319,6 +321,11 @@ impl Server {
};

let threads = self.threads;
info!(
"Server({}) is linsten on:{addr}, threads:{threads:?}, tls:{}",
&self.name,
tls_settings.is_some()
);
let mut lb = http_proxy_service(conf, self);
lb.threads = threads;

Expand Down
5 changes: 5 additions & 0 deletions web/src/pages/location-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export default function LocationInfo() {
option: 2,
value: "pingap:requestId",
},
{
label: "pingap:ping",
option: 3,
value: "pingap:ping",
},
];
if (config.proxy_plugins) {
Object.keys(config.proxy_plugins).forEach((name) => {
Expand Down

0 comments on commit a0718d0

Please sign in to comment.