Git Product home page Git Product logo

Comments (6)

stevenschlansker avatar stevenschlansker commented on August 20, 2024 2

Maybe you are looking for #31 which lets you control the log so as not to go to standard out?

from otj-pg-embedded.

binakot avatar binakot commented on August 20, 2024

I have a question close to this one.
I import last release otj-pg-embedded 0.9.0 and use slf4j+log4j2 for logging.
I'm working under Windows 10. Everything works. But tests with SingleInstancePostgresRule write corrupted charset logs in Intellij IDEA console:

2017-07-20 16:53:06.016 INFO   [main][EmbeddedPostgres][EmbeddedPostgres.java:613] Detected a Windows x86_64 system
2017-07-20 16:53:06.081 INFO   [main][EmbeddedPostgres][EmbeddedPostgres.java:679] Postgres binaries at C:\Users\IVANMU~1\AppData\Local\Temp\embedded-pg\PG-01856e144a4b170a72702240e1e507fe
2017-07-20 16:53:06.083 TRACE  [main][EmbeddedPostgres][EmbeddedPostgres.java:124] df046e03-58ff-4572-978e-5ba427efe442 postgres data directory is C:\Users\IVANMU~1\AppData\Local\Temp\embedded-pg\df046e03-58ff-4572-978e-5ba427efe442
�����, ����������� � ���� ����, ����� ������������ ������������ "Ivan Muratov".
�� ��� ����� ����� ����� ����������� ������� �������.

������� ��� ������ ����� ��������������� � ������� "Russian_Russia.1251".
������� ������������ ���������� ������ �� ��������� "russian".

�������� ����������� ������� ������ ��������.

How can I fix this? And what's it?

from otj-pg-embedded.

binakot avatar binakot commented on August 20, 2024

I tried to change log level for EmbeddedPostgres:

<logger name="com.opentable.db.postgres.embedded.EmbeddedPostgres" level="WARN" includeLocation="true"/>

It hides EmbeddedPostgres logs, but there is logs without logger name and my logs looks like this:

�����, ����������� � ���� ����, ����� ������������ ������������ "Ivan Muratov".
�� ��� ����� ����� ����� ����������� ������� �������.

������� ��� ������ ����� ��������������� � ������� "Russian_Russia.1251".
������� ������������ ���������� ������ �� ��������� "russian".

�������� ����������� ������� ������ ��������.

����������� ���� ��� ������������� �������� C:/Users/IVANMU~1/AppData/Local/Temp/embedded-pg/502f4f12-adcd-4837-bcd3-bf57f626cef6... ��
�������� ������������... ��
���������� �������� max_connections... 100
���������� �������� shared_buffers... 128MB
����� ���������� ������������ ����������� ������ ... windows
�������� ���������������� ������... ��
����������� ���������������� ������ ... ��
����������� �������������� ������������� ... ��
���������� ������ �� �����... ��

������. ������ �� ������ ��������� ������ ��� ������:

    "C:\Users\IVANMU~1\AppData\Local\Temp\embedded-pg\PG-01856e144a4b170a72702240e1e507fe\bin\pg_ctl" -D "C:\Users\IVANMU~1\AppData\Local\Temp\embedded-pg\502f4f12-adcd-4837-bcd3-bf57f626cef6" -l logfile start

������ �����������
���������:  ������� �� ���� ���������: 2017-07-21 10:34:17 MSK
���������:  ������ �� ��������� ���������������� ������ ��������
���������:  ������� �� ������ ��������� �����������
���������:  ������� ������� ����������� ������
���������:  ������� ������ �� ������� ����������
���������:  ���������� ���� �������� ����������
�������� ���������� ������ �������....���������:  ������� ������� ����������� �����������
ВАЖНО:  закрытие подключения по команде администратора
ОПЕРАТОР:  CREATE DATABASE ktrzwhnelptb OWNER postgres ENCODING = 'utf8'
���������:  ����������
���������:  ������� �� ���������
 ������
������ ����������

Process finished with exit code 0

from otj-pg-embedded.

binakot avatar binakot commented on August 20, 2024

I found the fix for that, just to force UTF-8 encoding in build.gradle:

compileJava.options.encoding = 'UTF-8'

But I still don't know how to disable these logs like the author of issue.

from otj-pg-embedded.

binakot avatar binakot commented on August 20, 2024

@stevenschlansker Oh, thanks. That could help. As I understand there is no way to redirect the embedded postgres logging to slf4j for example. But now I can hide the log totally. It is not good, but will keep my console clean. Thanks again ☕️

from otj-pg-embedded.

stevenschlansker avatar stevenschlansker commented on August 20, 2024

slf4j redirection is not built in right now, but PRs welcome :)

from otj-pg-embedded.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.