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

API question #472

Open
olegZatu opened this issue Aug 24, 2021 · 1 comment
Open

API question #472

olegZatu opened this issue Aug 24, 2021 · 1 comment
Labels
Question Further information is requested

Comments

@olegZatu
Copy link

In file: oatpp/core/base/Environment.hpp

Question

Hi

Can we define oatpp to log into a file?

Thanks.

@lganzzzo
Copy link
Member

Hello @olegZatu ,

Sure - you can customize oatpp logger:

class MyLogger : public oatpp::base::Logger {
public:
  void log(v_int32 priority, const std::string& tag, const std::string& message) override {
     std::cout << "MyCustomLog - " << message << std::endl;
    // TODO - change std::cout to whatever 
  }
};

...

oatpp::base::Environment::init(std::make_shared<MyLogger>());

@lganzzzo lganzzzo added the Question Further information is requested label Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants