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 #672

Open
houshmand-2005 opened this issue Dec 2, 2023 · 1 comment
Open
Assignees
Labels
Bug Something isn't working Core In Progress P2

Comments

@houshmand-2005
Copy link

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?

@omid-sadeghi
Copy link

omid-sadeghi commented Jun 2, 2024

با سلام
این رفتار پنل مرزبان که وقتی لاگ رو در فایل ذخیره می‌کنیم، دیگه لاگ نشون نمیده باعث میشه که اسکریپت V2IpLimit از کار بیفته چون این اسکریپت از لاگ‌های پنل مرزبان برای شمردن تعداد آیپی‌های هر کاربر استفاده میکنه.

@erfjab erfjab added the Backend label Jul 31, 2024
@erfjab erfjab assigned houshmand-2005 and unassigned SaintShit Sep 1, 2024
@erfjab erfjab added Bug Something isn't working P2 Core In Progress and removed Backend labels Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Core In Progress P2
Projects
None yet
Development

No branches or pull requests

4 participants