Comments (8)
@pmwmedia Please help me with it.
from tinylog.
Can you create a minimal reproduction project? Just fork tinylog-android-example, add your tinylog.properties
, and add your storage permissions to the forked project. If we are able to reproduce your issue by using the official Android example project, we can probably find the root cause for your issue.
from tinylog.
@pmwmedia Current Status -
After some more adding some media permissions I am able to write to the file when using write: file
But still when I try to use writer: Rolling File, and to check if the previous files are stores in the arhives I keep a miniml size in the policy. You can find my tinylog.properties file over here -
writer = rolling file
writer.directory = /storage/emulated/0/Android/data/com.palisisag.pitapp/files
writer.file = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/myLogFile.txt
writer.policies = size:10
#writer.archiveFormat = /storage/emulated/0/Android/data/files/{#}archivedLog.txt
writer.archiveNumbering = DateAndSequence
writer.archiveDateFormat = yyyy-MM-dd
writer.maxArchiveFiles = 1000
Disable concurrent writes (if supported by your implementation)
writer.concurrentWrites = false
Define log format (optional)
writer.format = {date: HH:mm:ss.SSS} {class}.{method}() {level}: {message}
But the thing is now I can only see the last log in my myLogFile.txt and I do not find my previous logs, I am really confused regarding the where the previous logs are going.
And also I can see the tinyLogs implementation with Android API 34(using Kotlin), is too flaky.
Do help me with some suggestions.
Thanks
from tinylog.
Attaching the screenshot of my emulator file explorer -
from tinylog.
Hi @pmwmedia I have fixed everything, now my tinylog.properties looks something like this -
writer = rolling file
writer.directory = /storage/emulated/0/Android/data/com.palisisag.pitapp/files
writer.file = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/archive/archivedLogFile_{count}.txt
#writer.latest = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/myLogFile.txt
#writer.latest = {tinylog.directory}/log.txt
writer.policies = startup, daily: 00:00, size:100
#writer.archiveFormat = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/archive/{#}.txt
#writer.archiveNumbering = DateAndSequence
writer.convert = gzip
#writer.archiveDateFormat = yyyy-MM-dd
writer.backups = 10
writer.concurrentWrites = false
writer.format = {date: HH:mm:ss.SSS} {class}.{method}() {level}: {message}
The only issue I am having is I want my writer.latest to point at the current log file outside the archive folder, but its giving me this warning -
LOGGER WARN: Cannot create link to latest log file on Android.
Any workaround for this one ?
from tinylog.
@pmwmedia Currently I moved the last file created inside the logger directory manually to the desired desctination, let me know if you have any other better method in mind.
from tinylog.
Android doesn't support hard links and there is no workaround. However, you will still find the latest log file in /storage/emulated/0/Android/data/com.palisisag.pitapp/files/archive/archivedLogFile_{count}.txt
. It is the file with the highest count number.
from tinylog.
Sorry for the late response. Cool got it. So I think we have to manually do it by moving the last file outside the archived folders, as per my requirement.
from tinylog.
Related Issues (20)
- Multiple Log Files created when rollover is initiated HOT 1
- Trying to use thread placeholder on Rolling File writer HOT 3
- tinylog not logging some messages when used via SLF4J 2.0 fluent API HOT 1
- Why Can't I find this package anywhere org.tinylog.rules HOT 1
- No clear way how to integrate with FastCSV HOT 1
- JSON Logging to the Console HOT 3
- Is there a way to tell if the logger is still active? HOT 2
- Circumvent "Error initializing logging: java.lang.UnsupportedOperationException" when using 3rd-party SDK that also uses tinylog for logging HOT 5
- Format time in UTC timezone HOT 1
- tinylog.properties does not seem to be read in version 2.6.2, but works in 2.5.0. HOT 3
- Logger class is missing stack trace error HOT 3
- Date placeholder in file name does not get applied HOT 3
- When attempting to build latest, I can't transfer animal-sniffer HOT 1
- How to programmatically set the log file path๏ผ HOT 2
- How to skip the log output of third-party packages? HOT 2
- TinyLog doesn't honor default log level HOT 1
- Can the log output of Logback and log4j2 be seamlessly migrated to tinylog for output? HOT 1
- Are there API exposed to forcefully flush the log buffer in File Writer mode ? HOT 3
- Change logging level at runtime when writingthread = true HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinylog.