Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with getting logs from Xray core When we save logs #911

Closed
erfjab opened this issue Apr 2, 2024 · 1 comment
Closed

Problem with getting logs from Xray core When we save logs #911

erfjab opened this issue Apr 2, 2024 · 1 comment
Labels
Duplicate This issue or pull request already exists

Comments

@erfjab
Copy link
Contributor

erfjab commented Apr 2, 2024

Hi, The problem is that when we save logs, logs are no longer displayed in the panel and API

After change config(xray_config.json) like this

"log": {
"loglevel": "info",
"access": "access.log",
"error": "error.log"
},
This is what Api and Panel shows:

Xray 1.8.4 (Xray, Penetrates Everything.) Custom (go1.21.0 linux/amd64)

A unified platform for anti-censorship.
2023/11/22 16:59:16 [Info] infra/conf/serial: Reading config: stdin:

And this is the contents of access.log file (this is right and ok):

2023/11/22 17:01:32 192.168.1.33:11421 accepted tcp192.168.1.36:443 [VLESS_INBOUND -> proxy] email: 1.Test
2023/11/22 17:01:36 192.168.1.33:11424 accepted tcp192.168.1.36:443 [VLESS_INBOUND -> proxy] email: 1.Test
2023/11/22 17:01:37 192.168.1.33:11430 accepted tcp192.168.1.36:443 [VLESS_INBOUND -> proxy] email: 1.Test
As I can understand when with Xray we save the logs Xray doesn't show them on stdout, so marzban can't catch them.
This is Marzban code to get logs:

...
def capture_only():
    while self.process:
        output = self.process.stdout.readline()
        if output:
            output = output.strip()
            ...

so marzban just read the stdout and when Xray is saving log file, it doesn't send logs into stdout.

I found this out when someone reported it in my script houshmand-2005/V2IpLimit#32

And if we remove the save location to just show the logs like this:

"log": {
"loglevel": "info"
},
Again the logs are sent without any problem.

Do you think something can be done for this?

bug report by @houshmand-2005

@erfjab erfjab added the Bug Something isn't working label Apr 2, 2024
@M03ED
Copy link
Collaborator

M03ED commented Apr 3, 2024

there is a open issue for this problem right now #672

@M03ED M03ED closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
@M03ED M03ED added Duplicate This issue or pull request already exists and removed Bug Something isn't working labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants