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

Log to stdout or stderr #2915

Closed
moltar opened this issue Dec 2, 2023 · 7 comments
Closed

Log to stdout or stderr #2915

moltar opened this issue Dec 2, 2023 · 7 comments

Comments

@moltar
Copy link

moltar commented Dec 2, 2023

Is your feature request related to a problem? Please describe.

I'd like to be able to log to STDOUT or STDERR.

Describe the solution you'd like

Rather than logging to a file, I'd like to be able to log to the console.

Describe alternatives you've considered

Looked into Monolog docs to see if it was possible, but did not find any solutions.

Additional context

I am using Docker and it's better to log to the screen, as that is then automatically ingested into CloudWatch logs.

@yurikuzn
Copy link
Contributor

yurikuzn commented Dec 3, 2023

It should be already possible.

https://docs.espocrm.com/administration/log/#handlers

https://github.com/Seldaek/monolog/blob/3.5.0/src/Monolog/Handler/StreamHandler.php

  'logger' => [
    'level' => 'NOTICE',
    'handlerList' => [
      [
        'className' => 'Monolog\\Handler\\StreamHandler',
        'params' => [
          'stream' =>  'php://stdout',
        ],
        'level' => 'NOTICE',
      ],
  ],

@yurikuzn yurikuzn closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2023
@moltar
Copy link
Author

moltar commented Dec 3, 2023

Thank you for the config sample.

But it's not possible to edit this config in a programmatic Docker based deployment way.

As the config is being touched by espocrm and written to.

And there's no way to supply your own as when config exists Docker image entry point will skip the installation.

I wish there was a way to provide a real config file that is the source of truth and EspoCRM shouldn't be writing to that.

@yurikuzn
Copy link
Contributor

yurikuzn commented Dec 3, 2023

I don't understand the problem. Log is configured through config, like many other things. It's possible to edit this file programmatically somehow. Anyway, it would be out of scope of the initial feature request.

@yurikuzn
Copy link
Contributor

yurikuzn commented Dec 3, 2023

https://github.com/espocrm/espocrm-docker/blob/8.0.5/apache/docker-entrypoint.sh#L59

This functions does not look good to me, as it accepts only strings. You may write your own based on its code I think.

You can also create your own config file before Espo is installed, with needed params. Other params will be added upon installation. Not sure how it works on our docker though.

Docker image entry point will skip the installation

If there's really such a problem and it can't be circumvented, we need to solve it. But I think it checks 'isInstalled' parameter in the config. If it's not true, it will install.

@arkadiyasuratov
Copy link
Contributor

It would be nice if we could have config drop-ins in data/config.d, allowing us to place our own config files, similar to how many programs operate in Linux. This folder can be read-only. This is something I wish Espo had when I was deploying the app to S3, as there was no option to enforce it with environment variables.

@yurikuzn
Copy link
Contributor

yurikuzn commented Dec 3, 2023

It's out of scope of this feature request. If directory, then the question, how to merge multiple files. What priority. Why directory, not a single file what would be more straightforward.

@yurikuzn
Copy link
Contributor

yurikuzn commented Dec 3, 2023

I created a separate issue: #2916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants