Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Well, Jim, I'm not much of an actor either.


devel / comp.lang.python / Breaking new relic format on a new line character in FileHandler appender

SubjectAuthor
o Breaking new relic format on a new line character in FileHandlerVijay Karavadra

1
Breaking new relic format on a new line character in FileHandler appender

<mailman.194.1636610320.23718.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=20359&group=comp.lang.python#20359

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: vijay.karavadra@marutitech.com (Vijay Karavadra)
Newsgroups: comp.lang.python
Subject: Breaking new relic format on a new line character in FileHandler
appender
Date: Wed, 10 Nov 2021 10:46:03 +0530
Lines: 50
Message-ID: <mailman.194.1636610320.23718.python-list@python.org>
References: <CABeRhcojoyA63zHT1C607xTigJ=DpgLcujDEvJ+hdvcPDCQfxA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de hryYFn2LojYXKRts6ti/cwiBAdF9WYsdh/S4gpiDDhxg==
Return-Path: <vijay.karavadra@marutitech.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=marutitech.com header.i=@marutitech.com header.b=WuspFLS1;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'traceback': 0.04; '(most':
0.05; '31,': 0.05; 'last):': 0.05; 'breaks': 0.09; 'log:': 0.09;
'properties': 0.09; 'represents': 0.09; 'log': 0.12; '-&gt;':
0.16; 'generates': 0.16; 'level,': 0.16; 'logs': 0.16; 'skip:"
60': 0.16; 'python': 0.16; 'instead': 0.17; 'to:addr:python-list':
0.20; 'issue': 0.21; "i've": 0.22; 'application.': 0.22; 'i.e.':
0.22; 'skip:& 40': 0.22; 'help.': 0.25; 'skip:{ 20': 0.26;
'local': 0.27; 'suggestions': 0.28; 'error': 0.29; 'present':
0.30; 'credentials': 0.32; 'message-id:@mail.gmail.com': 0.32;
"i'm": 0.33; 'skip:" 20': 0.34; 'received:google.com': 0.34;
'trying': 0.35; 'fine': 0.35; 'thanks,': 0.36; "skip:' 10": 0.37;
'received:209.85': 0.37; 'file': 0.38; 'received:209': 0.39;
'added': 0.39; 'single': 0.39; 'received:209.85.208': 0.39;
'sample': 0.61; 'format': 0.62; 'great': 0.63; 'skip:r 20': 0.64;
'url:name': 0.64; 'that,': 0.67; 'below': 0.69; 'name,': 0.75;
'skip:f 20': 0.75; 'formatting': 0.76; 'breaking': 0.78;
'is\xc2\xa0': 0.84; 'skip:" 50': 0.84; 'skip:& 50': 0.84;
'property': 0.88
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=marutitech.com; s=google;
h=mime-version:from:date:message-id:subject:to;
bh=6ix1/cEjOthPVajOsM1GkUY+mvcD72R6sd+X2bOPyQY=;
b=WuspFLS1mFCE6tnpBhg0/7Zj5vNnLMT6WkUp4BUk+DHP2zy+d3wWbsLlAz+tDOzAi0
tNudmHzlMq1+BXMrTDDLWouAH+bz0eRe1Z4SNrBI8qvXuRbcwmK66JcIXbjXNmviTOgX
jLWhAOCdavIc/VNOgtmD3Rl2Tw3bEoaYuwGLs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=6ix1/cEjOthPVajOsM1GkUY+mvcD72R6sd+X2bOPyQY=;
b=SVTfRdIvsq0N/Q74VQZa6Hqh4qd1OFkp65Zt+P7DM3dlRshe+ugN1ZgSBz9P+UTPdA
UfFP2zb/2lK9TvQMSwX3OfG09WaK9ihos4sKkuaQ/G+538kY4iyASf29dedXOMUfgvv7
TyNZbs9XhaHxqqZ1QssmS2C9z8F1H9VrMrAEr01ROIMbC1l9gqb/5Htxdm3GeQoPt8/X
Ek7zuH41q/z7i9qXFe4khQQEkhquWKA7+DrTdP6BG8YFyys5G2sZe1M7IM6Kun2tG+AE
+8cMfEUTkVylBVbBVGB132JM5eX7fpi1EVJyJ7F7aXSH8gqt1ozcLQ+bVt+ggQWALMna
uDKA==
X-Gm-Message-State: AOAM532dahMuNLSkYSnm2Z5RoMX9zIS2KuL3jIcw71em6YzZiVO+5XhH
7Z0tgEgbSrpL+K7hQ7fTPL/CPq3GOW6i4wGxiZz10FUa5fPgKTiZ
X-Google-Smtp-Source: ABdhPJyz3bQaKxvOOCmGe0/bF/2qx28CgGTu0Ot2SJscvuQfesnT8lFkwNXbZ+zyyAsMtI0I8ChDyhQdqScnza0unBo=
X-Received: by 2002:a17:906:3a0e:: with SMTP id
z14mr17501474eje.55.1636521373387;
Tue, 09 Nov 2021 21:16:13 -0800 (PST)
X-Mailman-Approved-At: Thu, 11 Nov 2021 00:58:39 -0500
X-Content-Filtered-By: Mailman/MimeDel 2.1.35
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CABeRhcojoyA63zHT1C607xTigJ=DpgLcujDEvJ+hdvcPDCQfxA@mail.gmail.com>
 by: Vijay Karavadra - Wed, 10 Nov 2021 05:16 UTC

Hello Team,

I'm trying to add logs in the new relic platform from a python application.
For that, I've to add logs in a local file in a specific format which is

'{"log.level":"%(levelname)s", "log.entity.name":"my-service-name",
"message":"%(message)s"}'

This works fine in normal scenario and generates the below type of
line in log file and logs are added to new relic with expected
properties set like log level, entity name, message etc.

{"log.level":"INFO", "log.entity.name":"my-service-name", "message":"test"}

This issue occurs when a new line is present in the message property of the
log i.e. on any error we have a message like "Traceback (most recent call
last):" which represents an error traceback after this line with a new line
character. In this case, multiple logs are added instead of a single log,
my expected formatting breaks and logging properties are not set in the new
relic.

Sample breaking log:

{"log.level":"ERROR", "log.entity.name":"my-service-name",
"message":"[Errno 2] No such file or directory:
'E:\\comms-nlp-service\\src\\GoogleAuthentication\\xyz.json' -> Traceback
(most recent call last):
File "E:\comms-nlp-service\src\app\nlp\carrier_cancel_apiai.py", line 31,
in query
credentials =
service_account.Credentials.from_service_account_file(filename, scopes
=(scope,))
File "C:\Python34\lib\site-packages\google\oauth2\service_account.py",
line 209, in from_service_account_file
filename, require=['client_email', 'token_uri'])
File
"C:\Python34\lib\site-packages\google\auth\_service_account_info.py", line
71, in from_filename
with io.open(filename, 'r', encoding='utf-8') as json_file:
FileNotFoundError: [Errno 2] No such file or directory:
'E:\\comms-nlp-service\\src\\GoogleAuthentication\\ xyz .json'
"}

Any suggestions on this would be a great help.

--
Thanks,
Vijay Karavadra


devel / comp.lang.python / Breaking new relic format on a new line character in FileHandler appender

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor